func_code_string: #include <bits/stdc++.h>   using namespace std;   const int maxn = 7, n = 7, maxm = 101;   int m, cntblk = maxn, f[maxn], deg[maxn];   bool used[maxm];   class ed {    public:     int target, id;     char type;     ed(int t, int i, char ty) : target(t), id(i), type(ty){};   };   class ans {    public:     int id;     char type;     ans(int i, char ty) : id(i), type(ty){};   };   vector<ed> edge[maxn];   vector<ans> answer;   inline int getf(int x) { return f[x] == x ? x : f[x] = getf(f[x]); }   void euler(int x, int in_id, char in_type) {     for (vector<ed>::iterator vi = edge[x].begin(); vi != edge[x].end(); vi++) {       if (used[(*vi).id]) continue;       used[(*vi).id] = true;       euler((*vi).target, (*vi).id, (*vi).type);     }     if (in_id >= 0) answer.push_back(ans(in_id, in_type));   }   int main() {     cin >> m;     for (int i = 0; i < n; i++) f[i] = i, deg[i] = 0;     for (int i = 1, x, y; i <= m; i++) {       cin >> x >> y;       deg[x]++;       deg[y]++;       edge[x].push_back(ed(y, i,  + ));       edge[y].push_back(ed(x, i,  - ));       if (getf(x) == getf(y)) continue;       f[getf(x)] = getf(y);       cntblk--;     }     int tmp = 0, s = -1;     for (int i = 0; i < n; i++) {       cntblk -= (deg[i] == 0);       tmp += (deg[i] & 1);       if (deg[i] > 0 && (s == -1 || deg[i] & 1)) s = i;     }     if (cntblk != 1 || !(tmp == 0 || tmp == 2)) {       puts( No solution );       return 0;     }     memset(used, false, sizeof(used));     euler(s, -1,  + );     for (vector<ans>::reverse_iterator vi = answer.rbegin(); vi < answer.rend();          vi++) {       printf( %d %c n , (*vi).id, (*vi).type);     }     return 0;   }   