#include <iostream>
using namespace std;


bool es_guai(int n, int b);


int main() {
  int n, b;
  while (cin >> n >> b) cout << es_guai(n, b) << endl;
}
