#include using namespace std; int main() { int N, M; cin >> N >> M; for (int i = 0; i < M; ++i) { int A, B; cin >> A >> B; if (A < B) { cout << 0 << endl; } else { cout << 1 << endl; } cout.flush(); } return 0; }