#include int main() { int M, a, b; std::cin >> M >> M; while (M--) { std::cin >> a >> b; std::cout << (a < b) << std::endl; } }