import java.io.FileNotFoundException; import java.io.IOException; import java.io.InputStream; import java.math.BigInteger; import java.util.Arrays; import java.util.NoSuchElementException; import java.util.Scanner; public class Main { public static void main(String[] args) throws FileNotFoundException { long t = System.currentTimeMillis(); new Main().run(); System.err.println(System.currentTimeMillis() - t); } void run() { Scanner sc = new Scanner(System.in); int T=Integer.valueOf(sc.nextLine()); for(int t=0;t0&&!(0<=(int)(s.charAt(p-1)-'0')&&9>=(int)(s.charAt(p-1)-'0')))--p; int last=p; while(p>0&&0<=(int)(s.charAt(p-1)-'0')&&9>=(int)(s.charAt(p-1)-'0')) { --p; } if(last!=0) { BigInteger tail=new BigInteger(s.substring(p,last)); tail=tail.add(BigInteger.ONE); String tail_str=tail.toString(); while(tail_str.length()