! 2019.9.21 
! A
! Error --> 9999
! Correct(H /= 1) --> 8888
! Correct(H = 1) --> 7777
! Correct(W = 1) --> 6666
      program answer
      implicit none
      integer :: H, W, A, B  !input number
      double precision :: Hd, Wd, Ad, Bd
      integer(8) :: i,j
      integer :: mod_j
      integer,allocatable,dimension(:,:) :: ans
      intrinsic dble,mod
! read input number
      read(*,*) H, W, A, B
! H + A > W
      allocate(ans(H,W))
!
      ans = 0
!
      Hd=dble(H)
      Wd=dble(W)
      Ad=dble(A)
      Bd=dble(B)
! B > H/2
      if( Bd .gt. Hd/2.0d0) goto 9999
! H = 1
      if( H .eq. 1) goto 7777
! A > W/2
      if( Ad .gt. Wd/2.0d0) goto 9999
! W = 1
      if( W .eq. 1) goto 6666
! B = 0(H /= 1 & W /= 1)
      if( B .eq. 0) then
        if( W .eq. A) then
          goto 8888
        else
          goto 9999
        end if
! B /= 0(H /= 1 & W /= 1)
      else
        if( Hd*Ad/Bd .eq. Wd) then
          goto 8888
        else
          goto 9999
        end if
      end if
! Output(6666)
6666  do i=1,B
        ans(i,1) = 1
      end do
      do i=1,H
        write(*,'(I1)') ans(i,1)
      end do
      stop
! Output(7777)
7777  do j=1,A
        ans(1,j) = 1
      end do
      write(*,'(1000I1)') (ans(1,j),j=1,W)
      stop
! Output(8888)
8888  do i=1,H
        do j=A*i,A*(i+1)-1
          mod_j = mod(j,W)
          if( mod_j == 0) mod_j = W
          ans(i,mod_j) = 1
        end do
      end do
      do i=1,H
        write(*,'(1000I1)') (ans(i,j),j=1,W)
      end do
      stop
! Error(9999)
9999  write(*,*) 'No'
      stop
      end program answer