#include using namespace std; #define ll long long // #include // #include // using namespace std; // using namespace __gnu_pbds; // typedef tree< // int, // null_type, // less, // rb_tree_tag, // tree_order_statistics_node_update> // ordered_set; // #define ll long long // class Solution { // public: // vector safeNodes(int V, vector>& edges) { // // Code here // vector>adj(V); // vectorindegree(V, 0); // for (int i = 0; i < edges.size(); i++) { // int first = edges[i][0]; // int second = edges[i][1]; // adj[second].push_back(first); // indegree[first]++; // } // queueq; // for (int i = 0; i < V; i++) { // if (indegree[i] == 0) q.push(i); // } // vectorans; // while (!q.empty()) { // int node = q.front(); // q.pop(); // ans.push_back(node); // for (auto it: adj[node]) { // indegree[it]--; // if (indegree[it] == 0) { // q.push(it); // } // } // } // return ans; // } // }; // bool bfs(vector>&adj, vector&color, ll node) { // queue>q; // q.push({node, 1}); // color[node] = 1; // while (!q.empty()) { // ll num = q.front().first; // ll col = q.front().second; // ll toColor = col == 1 ? 2 : 1; // q.pop(); // for (auto it: adj[num]) { // if (color[it] == -1) { // q.push({it, toColor}); // color[it] = toColor; // } // else if (color[it] != -1 && color[it] == col) { // return false; // } // } // } // return true; // 1 // } // ll cntBits(ll x) { // ll cnt = __builtin_popcount(x); // //__builtin_popcountll(x); // return x; // } // struct Compare { // bool operator()(int a, int b) const { // return a > b; // } // }; // void dijkstra() { // ll n, m; // cin >> n >> m; // vector>>adj(n + 1); // for (ll i = 0; i < m; i++) { // ll a, b, c; // cin >> a >> b >> c; // adj[a].push_back({b, c}); // } // priority_queue, vector>, greater>>pq; // vectordist(n+ 1, LLONG_MAX); // pq.push({0, 1}); // dist[1] = 0; // while (!pq.empty()) { // ll node = pq.top().second; // ll distance = pq.top().first; // pq.pop(); // if (distance != dist[node]) continue; // for (auto it: adj[node]) { // ll weight = it.second; // if (distance + weight < dist[it.first]) { // dist[it.first] = distance + weight; // pq.push({distance + weight,it.first}); // } // } // } // for (ll i =1; i <= n; i++) { // cout << dist[i] << " "; // } // cout << endl; // } // vector spf(N); // void buildSPF(int N) { // for (int i = 0; i < N; i++) spf[i] = i; // for (int i = 2; i * i < N; i++) { // if (spf[i] == i) { // i is prime // for (int j = i * i; j < N; j += i) { // if (spf[j] == j) // mark only first time // spf[j] = i; // } // } // } // } // vector getFactors(int x) { // vector factors; // while (x > 1) { // factors.push_back(spf[x]); // x /= spf[x]; // } // return factors; // } vector trial_division1(long long n) { vector factorization; for (long long d = 2; d * d <= n; d++) { while (n % d == 0) { factorization.push_back(d); n /= d; } } if (n > 1) factorization.push_back(n); return factorization; } void solve(){ // ll l, b, a; // cin >> l >> b >> a; // for (ll i = 1; i <= a; i++) { // if (a % i == 0) { // ll num1 = i; // ll num2 = a / i; // if (num1 % 2 != 0 && num2 %2 == 0) { // ll temp = a / num1; // if (num2 % temp == 0) { // if (temp * ) // } // } // if (l % num1 == 0 && b % num2 == 0 || (l % num2 == 0 && b % num1 == 0)) { // if (a/ i * i == a) { // cout << "YA" << endl; // } // } // } // } // cout << "TIDAK" << endl; ll a, b; cin >> a >> b; if ((a + b) % 2 == 0) { cout << 0 << endl; } else cout << 1 << endl; } int main() { ios::sync_with_stdio(false); cin.tie(nullptr); ll t; cin >> t; // while (t--) solve(); solve(); return 0; }