#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; int ans = (A < B ? 0 : 1); cout << ans << '\n' << flush; // interactive: must flush } return 0; }