#include <bits/stdc++.h>
using ll = long long;
using namespace std;

int main() {
    int x, y;
    cin >> x >> y;
    cout << 4 << endl;
    if (x == 0 && y == 0) {
        cout << 0 << " " << 0 << " " << 0 << " " << 0 << endl;
        int res;
        cin >> res;
        cout << res << endl;
    } else if (x == 1 && y == 1) {
        cout << 1 << " " << 1 << " " << 1 << " " << 1 << endl;
        int res;
        cin >> res;
        cout << res << endl;
    } else if (x == 0 && y == 1) {
        cout << 0 << " " << 1 << " " << 1 << " " << 1 << endl;
        int res;
        cin >> res;
        cout << res << endl;
    } else if (x == 1 && y == 0) {
        cout << 1 << " " << 0 << " " << 0 << " " << 0 << endl;
        int res;
        cin >> res;
        cout << res << endl;
    }
}