func_code_string: #include<bits/stdc++.h>   #define int long long   #define f first   #define s second   #define N 1010   #define M 1010   #define MOD 998244353   #define oo 1e18   using namespace std;   typedef pair<int,int> ii;   int v[N][N], estado[N];   set<int>freq[N][N];   int n;   void eraseLine(int line, queue<int>&unique) {       for(int c=0; c<n; c++) {           int val = v[line][c];           freq[c][val].erase(line);           if(freq[c][val].size() == 1) {               int line = *freq[c][val].begin();               unique.push(line);               freq[c][val].clear();           }       }   }   int32_t main() {       int t; cin >> t;       while(t--) {           cin >> n;           for(int l=0; l<2*n; l++) {               estado[l] = 0;               for(int i=0; i<=n; i++) {                   freq[l][i].clear();               }           }                      for(int l=0; l<2*n; l++) {               for(int c=0; c<n; c++) {                   cin >> v[l][c];                   freq[c][v[l][c]].insert(l);               }           }           queue<int>unique;           for(int c=0; c<n; c++) {               for(int i=1; i<=n; i++) {                   if(freq[c][i].size() == 1) {                       int line = *freq[c][i].begin();                       unique.push(line);                       freq[c][i].clear();                   }               }           }              int quantityAnswers = 1;           vector<int>example;              while(example.size() != n) {               int choosenLine = -1;               if(unique.size()) {                   choosenLine = unique.front();                   unique.pop();                   if(estado[choosenLine]) continue;               } else {                   quantityAnswers *= 2;                   quantityAnswers %= MOD;                                      choosenLine = -1;                   for(int l=0; l<=2*n; l++) {                       if(estado[l]) continue;                       choosenLine = l;                       break;                   }               }                  estado[choosenLine] = 2;               example.push_back(choosenLine);               for(int curLine=0; curLine<2*n; curLine++) {                   if(estado[curLine]) continue;                   for(int c=0; c<n; c++) {                       if(v[choosenLine][c] == v[curLine][c]) {                           estado[curLine] = 1;                           break;                       }                   }                      if(estado[curLine]) {                       eraseLine(curLine, unique);                   }               }               eraseLine(choosenLine, unique);           }              sort(example.begin(), example.end());           cout << quantityAnswers << endl;           for(int val:example) cout << val + 1 <<    ;           cout << endl;       }       return 0;   }