public static void main(String[] args) throws IOException {
		BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
		String line = "";
		StringBuilder out = new StringBuilder();
		fillBox(1000);
		while ((line = in.readLine()) != null && line.length() != 0) {
			int nCase = Integer.parseInt(line.trim());
			for (int i = 0; i < nCase; i++) {
				int n = Integer.parseInt(in.readLine().trim());
				out.append(box[n] + "\n");
			}
		}
		System.out.print(out);
	}