#include using namespace std; int main() { ios::sync_with_stdio(false); cin.tie(nullptr); int N, M; if (!(cin >> N >> M)) return 0; for (int i = 0; i < M; ++i) { int A, B; cin >> A >> B; cout << (A < B ? 0 : 1) << '\n'; cout.flush(); } return 0; }