public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		StringBuilder sb = new StringBuilder();
		int f = 0;
		d: do {
			int times = scan.nextInt();
			for (int i = 0; i < times; i++) {
				int n = scan.nextInt();
				sb.append(((f++!=0)?"\n":"")+proc(n));
			}
		} while (scan.hasNext());
		System.out.println(sb);
	}