using System; using System.Collections; using System.Collections.Generic; using System.Linq; using System.Text; using System.Numerics; using BI = System.Numerics.BigInteger; class TEST{ static void Main(){ Sol mySol =new Sol(); mySol.Solve(); } } class Sol{ public void Solve(){ for(int i=0;i=0;j--){ if(!found){ if(InRange(s[j],'0','9'+1)){ r = j; l = j; found = true; continue; } else { continue; } } if(found){ if(InRange(s[j],'0','9'+1)){ l = j; continue; } else { break; } } } if(!found){ Console.WriteLine(s); continue; } String left = s.Substring(0,l); String mid = s.Substring(l,(r-l+1)); String right = s.Substring(r+1); var num = BI.Parse(mid); num++; String nmid = num.ToString(); if(nmid.Length < mid.Length) nmid = nmid + new String('0',mid.Length - nmid.Length); Console.WriteLine(left + nmid + right); } } bool InRange(int t, int l, int r){ return l <= t && t < r; } int N; String[] S; public Sol(){ N = ri(); S = new String[N]; for(int i=0;iint.Parse(e));} static long[] rla(char sep=' '){return Array.ConvertAll(Console.ReadLine().Split(sep),e=>long.Parse(e));} static double[] rda(char sep=' '){return Array.ConvertAll(Console.ReadLine().Split(sep),e=>double.Parse(e));} }