/* package whatever; // don't place package name! */

import java.util.*;
import java.lang.*;
import java.io.*;
import java.util.stream.Collectors;

/* Name of the class has to be "Main" only if the class is public. */
class Ideone
{
	public static void main (String[] args) throws java.lang.Exception
	{
		String[] tests = new String[]{ "abcdefghijklmnopqrstuvwxyz"
									,"ABCDEFGHIJKLMNOPQRSTUVWXYZ"};
		int shift = -3;
		for (String str: tests) {
			String out = str.chars()
						.map(i -> mapChar(i, shift))
						.collect( StringBuilder::new
								, StringBuilder::appendCodePoint
								, StringBuilder::append)
						.toString();
			System.out.println(str + " -> " + out);
		}
	}
	
	public static int mapChar(int c, int shift) {
		final int alpha_len = 'z' - 'a' + 1;
		shift = shift % alpha_len + alpha_len * (shift < 0 ? 1 : 0);
		if ('a' <= c && c <= 'z') return (c + shift - 'a') % alpha_len + 'a';
		if ('A' <= c && c <= 'Z') return (c + shift - 'A') % alpha_len + 'A';
		return c;
	}
}