#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
using pint = pair<int,int>;

long long N, Q, K, D;
void solve() {
    --K, --D;
    long long pK = K, pD = D;
    for (int i = 0; i < Q; ++i) D = D * 2 % N;
    long long diff = (K - D + N) % N;

    // tmp: 逆順で見たときの 0: 2x、1: 2x+1
    vector<long long> tmp;
    while (diff) {
        tmp.push_back(diff & 1);
        diff >>= 1;
    }
    if (tmp.size() > Q) { cout << -1 << endl; return; }
    while (tmp.size() < Q) tmp.push_back(0);
    reverse(tmp.begin(), tmp.end());

    // 実際の操作に適合した復元
    vector<long long> res;
    for (int q = 0; q < tmp.size(); ++q) {
        long long nD = pD * 2;
        if (tmp[q]) ++nD;
        nD %= N;

        // nD -> pD が実際には 0 なのか 1 なのかを判定
        if (nD % 2 == 0) {
            if (pD == nD/2) res.push_back(0);
            else res.push_back(1);
        }
        else {
            if (pD == nD/2) res.push_back(1);
            else res.push_back(0);
        }
        pD = nD;
    }
    reverse(res.begin(), res.end());
    for (int i = 0; i < Q; ++i) cout << res[i] << endl;
}

int main() {
    cin >> N >> Q >> K >> D;
    solve();
}

