import java.util.Scanner; public class Main { public static void main(String[] args) throws Exception { Scanner sc = new Scanner(System.in); int t = sc.nextInt(); label: for (int z = 0; z < t; z++) { int n = sc.nextInt(); long a = 1; for (int i = 0; i < 18; i++) { a *= 10; if (a > n) { long b = a - n; StringBuilder sb = new StringBuilder(); sb.append(b); sb.append(0); sb.append(0); System.out.println(sb.toString()); continue label; } } } sc.close(); } }