import java.util.*; public class Lode { static int [] w = new int[100]; static int [] p = new int[100]; static { w[0] = 1; p[0] = 1; for (int i=1;i solve(int c) { List result = new ArrayList(); int i; for (i=0; w[i] <= c; i++) {} i--; while (c > 0) { int x; for (x=1; w[i] * x <= c; x++) {} x--; result.add(x); c -= w[i] * x; i--; } return result; } public static void main(String [] args) { /* for (int i=0; i<100; i++) { System.out.println(w[i] + " " + p[i]); } */ Scanner scanner = new Scanner(System.in); int cases = scanner.nextInt(); for (int cas=0; cas list = solve(c); for (int i : list) { System.out.print(i); } System.out.println(); } } }