#include <iostream>
using namespace std;


bool es_capicua(int n, int b);


int main() {
    int x, b;
    while (cin >> x >> b)
      cout << x << ' ' << b << ' ' << es_capicua(x, b) << endl;
}
