import java.util.; import java.io.; public class Main{ public static void main(String[] args)throws IOException{ BufferedReader in = new BufferedReader(new InputStreamReader(System.in)); String str = null; while((str = in.readLine())!=null){ // System.out.println(str); str = str.toLowerCase(); // System.out.println(str); Set set = new HashSet<>(); StringBuilder temp = new StringBuilder(); for(int i = 0;i < str.length();i++){ if(!set.contains(str.charAt(i))){ set.add(str.charAt(i)); temp.append(str.charAt(i)); } } // System.out.println(temp.toString()); char ch = 'a'; for(int i = 0;i < 26;i++){ if(!set.contains(ch)){ temp.append(ch); } ch++; } // System.out.println(temp.toString()); String lowCase = temp.toString(); String upperCase = lowCase.toUpperCase(); String source = in.readLine(); StringBuilder dest = new StringBuilder(); for(int i = 0;i < source.length();i ++){ char c = source.charAt(i); if(c >= 'a' && c <= 'z'){ dest.append(lowCase.charAt(c-'a')); }else if(c >= 'A' && c <= 'Z'){ dest.append(upperCase.charAt(c-'A')); }else { dest.append(c); } } System.out.println(dest.toString()); } } }