#define _CRT_SECURE_NO_WARNINGS #include #include #include #include #include using namespace std; typedef long long int ll; typedef unsigned long long int ull; #define REP(i,n) for(ll i=0; i=0; --i) #define FOR(i,a,n) for(ll i=a; i=a; --i) #define VDOUT(x) cerr << #x << "\n";for(auto i : x ) cerr << " " << i << "\n"; #define DOUT(x) cerr << #x << " = " << x << "\n"; #define COUT(x) cout << x << "\n"; #define COUT2(x,y) cout <> n; cin.ignore(); vector s; REP(i,n) { string tmp; getline(cin, tmp); s.push_back(tmp); } string num, txt_s,txt_e; REP(j, s.size()) { num = ""; txt_s = ""; txt_e = ""; REPR(i, s[j].length() - 1) { if ((s[j][i] >= '0' && s[j][i] <= '9')) { num = s[j][i]+num; } else if( num!="") { txt_s = s[j].substr(0, i + 1); break; } else { txt_e = s[j][i]+txt_e; } } if (num != "") { ull a = stoull(num) + 1; string tnum = to_string(a); int c = num.length() - tnum.length(); REP(k, c) { tnum = "0" + tnum; } num = tnum; } COUT(txt_s + num + txt_e); } return 0; }