public static void main(String[] args) throws IOException {
		BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
		String line = "";
		out = new StringBuilder();
		boolean noFirst = false;
		while ((line = in.readLine()) != null && line.length() != 0) {
			int n = Integer.parseInt(line);
			if (n == 0)
				break;
			if(noFirst)
				out.append("\n");
			noFirst = true;
			if(!cs(1234, n))
				out.append("There are no solutions for "+n+".\n");
		}
		System.out.print(out);
	}