#include using namespace std; int main() { ios::sync_with_stdio(false); cin.tie(nullptr); 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; }