program zero_one_matrix
  implicit none
  integer :: h, w, a, b, x(1000,1000) = 0, i, j
  read(*,*) h, w, a, b
  if (a == 0) a = w
  if (b == 0) b = h
  x(1:b,1:a) = 1
  x(b+1:h,a+1:w) = 1
  do i = 1, h
    do j = 1, w
      write(*,'(i0)',advance='no') x(i,j)
    end do
    write(*,*)
  end do
end program zero_one_matrix