#include #define rep(i,a,b) for(int i=a;i p = {-1, -1}; rep(L, 0, S.length()) if('0' <= S[L] && S[L] <= '9') { int R = L + 1; while ('0' <= S[R] && S[R] <= '9') R++; p = { L, R - 1 }; L = R - 1; } if (p.first < 0) { printf("%s\n", S.c_str()); return; } string A = S.substr(0, p.first); string B = S.substr(p.first, p.second - p.first + 1); string C = S.substr(p.second + 1); B = incriment(B); printf("%s%s%s\n", A.c_str(), B.c_str(), C.c_str()); } //--------------------------------------------------------------------------------------------------- void _main() { int T; cin >> T; string S; getline(cin, S); rep(i, 0, T) solve(); }