#include <iostream>
#include <vector>
#include <algorithm>
#include <cmath>
#include <string>
#include <set>
#include <cassert>
#include <map>
#define int long long
using namespace std;

void solve() {
    int n, k;
    cin >> n >> k;
    vector<tuple<int, int, int>> l;
    l.emplace_back(4, 2, 4);
    for (int p = 3; p <= 17; p++) {
        for (int v1 = (p - 2) * (1ll << p); v1 < (p - 1) * (1ll << p); v1+=4) {
            l.emplace_back(v1, p - 1, (1ll << p));
        }
        l.emplace_back((p - 1) * (1ll << p), p, (1ll << p));
    }
    vector<int> lst(18, 0);
    for (int i = 0; i < (int)l.size(); i++) lst[get<1>(l[i])] = i;

    while (n--) {
        int x;
        cin >> x;
        vector<int> out;
        if (x % 4 != 0) {
            cout << -1 << '\n';
            continue;
        }
        int ost = k;
        int fl = upper_bound(l.begin(), l.end(), make_tuple(x + 1, -1, -1)) - l.begin() - 1;
        while (x) {
            // cout << "X " << x << endl;
            // cout << "FL " << fl << "   " << get<0>(l[fl]) << " " << get<1>(l[fl]) << " " << get<2>(l[fl]) << endl;;
            if (ost < 2) break;
            if (get<1>(l[fl]) <= ost) {
                x -= get<0>(l[fl]);
                out.push_back(get<2>(l[fl]));
                // cout << "ous " << out.back() << endl;
                ost--;
                // if (x == 0) break;
            } else {
                assert(0);
            }
            fl = min({fl, lst[ost], (int)(upper_bound(l.begin(), l.end(), make_tuple(x + 1, -1, -1)) - l.begin() - 1)});
            // cout << "FL " << fl << "   " << get<0>(l[fl]) << " " << get<1>(l[fl]) << " " << get<2>(l[fl]) << endl;;
        }
        if (x == 0) {
            cout << (int)out.size() << " ";
            for (int el : out) cout << el << " ";
            cout << '\n';
        } else {
            cout << -1 << '\n';
        }
    }
}

signed main() {
    int t = 1;
    //cin >> t;
    while (t--) {
        solve();
    }
}
