// Arup Guha
// 8/25/2021
// Sample Code that encrypts and decrypts the shift cipher.

import java.util.*;

public class shift_cipher {

	public static void main(String[] args) {
	
		Scanner stdin = new Scanner(System.in);

		// Get a string.
		System.out.println("enter a lowercase string.");
		String str = stdin.next();
		
		// Print it encrypted with a shift of 12.
		char[] ans = encrypt(str.toCharArray(), 12);
		System.out.println(new String(ans));
	
		// Decrypt the ciphertext to get the message back.
		char[] back = decrypt(ans, 12);
		System.out.println(new String(back));
	
	}
	
	// Assume plain is all lowercase chars.
	public static char[] encrypt(char[] plain, int key) {
	
		// Will store answer here.
		char[] res= new char[plain.length];
		
		// For each character we must go from ascii-->[0,25]-->encrypt-->ascii
		for (int i=0; i<res.length; i++)
			res[i] = (char)(((plain[i]-'a') + key)%26 + 'a');
			
		return res;
	}
	
	// Assume plain is all lowercase chars.
	public static char[] decrypt(char[] cipher, int key) {
	
		// Will store answer here.
		char[] res= new char[cipher.length];
		
		// For each character we must go from ascii-->[0,25]-->encrypt-->ascii
		// Watch out for negative mods!!!
		for (int i=0; i<res.length; i++)
			res[i] = (char)(((cipher[i]-'a') - key+26)%26 + 'a');
			
		return res;
	}	
}