intfindFather(int x){ return x == f[x] ? x : f[x] = findFather(f[x]); }
boolcheck(string &a, string &b, int len){ int cnt = 0; for (int i = 0; i < len; i++) { if (a[i] != b[i]) { cnt++; if (cnt > 2) return0; } } return1; }
intnumSimilarGroups(vector<string> &strs){ int n = strs.size(); if (n == 0) return0; f.resize(n); for (int i = 0; i < n; i++) f[i] = i; int len = strs[0].size(), ans = 0; for (int i = 0; i < n; i++) { for (int j = i + 1; j < n; j++) { int fi = findFather(i), fj = findFather(j); if (fi == fj) continue; if (check(strs[i], strs[j], len)) { f[fi] = fj; } } } for (int i = 0; i < n; i++) if (f[i] == i) ans++; return ans; } };
classSolution { private: int m, n, dir[4][2] = {0, 1, 0, -1, 1, 0, -1, 0}; public: boolcheck(int x, vector<vector<int>> &grid){ queue<pair<int, int>> q; vector<int> vis(m * n); pair<int, int> a, b; q.push({0, 0}); vis[0] = 1; while (!q.empty()) { a = q.front(); q.pop(); if (a.first == m - 1 && a.second == n - 1) { return1; } for (int i = 0; i < 4; i++) { b.first = a.first + dir[i][0]; b.second = a.second + dir[i][1]; if (b.first >= 0 && b.first < m && b.second >= 0 && b.second < n && !vis[b.first * n + b.second] && grid[b.first][b.second] <= x) { vis[b.first * n + b.second] = 1; q.push(b); } } } return0; }
intswimInWater(vector<vector<int>> &grid){ m = grid.size(), n = grid[0].size(); int l = grid[0][0], r = 2500; while (l <= r) { int mid = l + r >> 1; if (check(mid, grid)) r = mid - 1; else l = mid + 1; } return l; } };
s = input() for i inrange(11, 27): if i == 20: continue a = s.replace(chr(97 + i - 1), chr(97 + i // 10 - 1) + chr(97 + i % 10 - 1)) if a != s: print(a) sys.exit(0) a = s.replace(chr(97 + i // 10 - 1) + chr(97 + i % 10 - 1), chr(97 + i - 1)) if a != s: print(a) sys.exit(0) print(-1)