func_code_string: #include <bits/stdc++.h>   using namespace std;   int xd[] = {0, 1, 0, -1};   int yd[] = {1, 0, -1, 0};   int xx[] = {0, 1, 0, -1, 1, -1, 1, -1};   int yy[] = {1, 0, -1, 0, 1, 1, -1, -1};   int kx[] = {-2, -1, -2, -1, 1, 2, 2, 1};   int ky[] = {1, 2, -1, -2, -2, -1, 1, 2};   bool islucky(int x) {     int four = 0, seven = 0;     while (x) {       if (x % 10 != 7 && x % 10 != 4) return false;       if (x % 10 == 7)         seven++;       else         four++;       x = x / 10;     }     return four == seven;   }   bool is_prime(long long x) {     if (x == 1) return false;     for (int i = 2; i * i <= x; i++)       if (x % i == 0) return false;     return true;   }   long long C(int k, int l) {     if (l == k) return 1;     if (l * 2 > k) l = k - l;     long long res = 1, temp = l;     for (int i = k - l + 1; i <= k; i++) {       res *= i / temp;       temp--;     }     return res;   }   long long sumOfDigit(int x) {     int res = 0;     while (x) {       res += x % 10;       x /= 10;     }     return res;   }   uint64_t bigPow(uint64_t base, uint64_t p) {     uint64_t temp = 1;     while (p--) {       temp *= base;     }     return temp;   }   vector<int> soso;   bool prime[10000001] = {0};   void SieveOfEratosthenes(int n) {     soso.push_back(2);     for (int p = 3; p * p <= n; p += 2) {       if (prime[p] == false) {         for (int i = p * 2; i <= n; i += p) prime[i] = true;       }     }     for (int i = 3; i <= n; i += 2)       if (!prime[i]) soso.push_back(i);   }   vector<vector<int> > AdjList;   bool visited[100005];   void dfs(int s) {     if (visited[s]) return;     visited[s] = 1;     for (int i = 0; i < AdjList[s].size(); i++) dfs(AdjList[s][i]);     return;   }   long long gcd(int a, int b) { return b == 0 ? a : gcd(b, a % b); }   unsigned long long fact(long long a) {     unsigned long long ans = 1;     for (int i = 1; i <= a; i++) ans *= i;     return ans;   }   bool lucky(int x) {     while (x) {       if (x % 10 == 7) return true;       x /= 10;     }     return false;   }   int main() {     int t;     cin >> t;     while (t--) {       vector<pair<pair<int, int>, int> > q;       int n;       cin >> n;       for (int i = 0; i < n; i++) {         int l, r;         cin >> l >> r;         q.push_back(make_pair(make_pair(l, i), r));       }       sort(q.begin(), q.end());       int w = 0, last = 0;       vector<pair<int, int> > turn;       for (int i = 0; i < q.size(); i++) {         if (q[i].second < max(q[i].first.first, last + 1)) {           turn.push_back(make_pair(q[i].first.second, 0));           w++;         } else {           turn.push_back(               make_pair(q[i].first.second, max(q[i].first.first, last + 1)));           last = max(q[i].first.first, last + 1);         }       }       sort(turn.begin(), turn.end());       for (int i = 0; i < turn.size(); i++) cout << turn[i].second <<    ;       cout << endl;     }   }   