private void solve() {
		Scanner scanner = new Scanner(System.in);
		a = scanner.nextInt();
		m = scanner.nextInt();
		seed = scanner.nextInt();
		scanner.nextLine();
		String line = scanner.nextLine();
		while (line != null) {
			char[] encryptedText = line.toCharArray();
			for (int i = 0; i < encryptedText.length; i++) {
				boolean isPrinted = false;
				// try all the characters
				for (char j = 0x20; j <= 0x7e; j++) {
					if (encryptedText[i] == encrypt(j)) {
						seed = tentativeSeed;
						System.out.print((char) j);
						isPrinted = true;
						break;
					}
				}
				if (!isPrinted)
					System.err.printf("char %c not printed!", encryptedText[i]);
			}
			System.out.println();
			line = scanner.nextLine();
		}
	}