import java.util.Scanner ;
public class Main {
public static void main ( String[] args ) {
Scanner sc = new Scanner ( System.in ) ;
// 以字串的模式輸入
String string = sc.nextLine () ;
// 轉換成字元陣列
char[] words = string.toCharArray () ;
int move = sc.nextInt () ; // 要移動的距離
// 進行加密
for ( int element = 0 ; element < words.length ; element += 1 ) {
int test = words[element] ; // 將字元轉換成int模式
test += move ;
// 判斷是否為字元
if ( Character.isLetter ( words[element] ) ) {
// 判斷字母大小寫
if ( Character.isUpperCase ( words[element] ) && test > 'Z' ) {
test -= 26 ;
}
else if ( test > 'z' ) {
test -= 26 ;
}
words[element] = (char)test ;
} // 判斷是否為數字
else if ( Character.isDigit ( words[element] ) ) {
if ( test > '9' ) {
test -= 10 ;
}
words[element] = (char)test ;
}
}
// 顯示加密後的字串
System.out.println ( new String ( words ) ) ;
}
}