#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int,int> P;
typedef pair<int,P> P1;
typedef pair<P,P> P2;
#define pu push
#define pb push_back
#define mp make_pair
#define eps 1e-7
#define INF 1000000000
#define mod 1000000007 
#define fi first
#define sc second
#define rep(i,x) for(int i=0;i<x;i++)
#define repn(i,x) for(int i=1;i<=x;i++)
#define SORT(x) sort(x.begin(),x.end())
#define ERASE(x) x.erase(unique(x.begin(),x.end()),x.end())
#define POSL(x,v) (lower_bound(x.begin(),x.end(),v)-x.begin())
#define POSU(x,v) (upper_bound(x.begin(),x.end(),v)-x.begin())

ll n,q,k,d;
ll beg[1000005];
int main(){
	cin>>n>>q>>k>>d;
	ll cur = d; beg[0] = cur;
	rep(i,q){
		if(cur > n/2) cur -= n/2;
		cur = 2*cur-1;
		beg[i+1] = cur;
	}
	//cur+x = k (mod n)
	//x = k-cur (mod n)
	ll hoge = k-cur;
	hoge = (hoge%n+n)%n;
	if(q < 51 && hoge >= (1LL<<q)){
		puts("-1");
	}
	else{
		vector<int>vec;
		ll V = hoge;
		for(int i=0;V;i++,V/=2){
		    ll up = beg[q-i-1]+V/2;
		    while(up > n) up-=n;
		    if(up > n/2){
			    vec.pb( ((hoge>>i)&1) );   
		    }
		    else{
		        vec.pb( 1-((hoge>>i)&1) );   
		    }
		}
		while(vec.size() < q){
		    ll up = beg[q-vec.size()-1];
		    if(up > n/2){
			    vec.pb( 0 );   
		    }
		    else{
		        vec.pb( 1 );   
		    }
		}
		for(int i=0;i<q;i++) printf("%d\n",1-vec[i]);
	}
}
