Problem: There are two popular keyboard layouts in Berland, they differ only in letters positions. All the other keys are the same. In Berland they use alphabet with 26 letters which coincides with English alphabet.

You are given two strings consisting of 26 distinct letters each: all keys of the first and the second layouts in the same order. 

You are also given some text consisting of small and capital English letters and digits. It is known that it was typed in the first layout, but the writer intended to type it in the second layout. Print the text if the same keys were pressed in the second layout.

Since all keys but letters are the same in both layouts, the capitalization of the letters should remain the same, as well as all other characters.

Input

The first line contains a string of length 26 consisting of distinct lowercase English letters. This is the first layout.

The second line contains a string of length 26 consisting of distinct lowercase English letters. This is the second layout.

The third line contains a non-empty string s consisting of lowercase and uppercase English letters and digits. This is the text typed in the first layout. The length of s does not exceed 1000.

Output

Print the text if the same keys were pressed in the second layout.

Examples

Input

qwertyuiopasdfghjklzxcvbnm
veamhjsgqocnrbfxdtwkylupzi
TwccpQZAvb2017


Output

HelloVKCup2017


Input

mnbvcxzlkjhgfdsapoiuytrewq
asdfghjklqwertyuiopzxcvbnm
7abaCABAABAcaba7


Output

7uduGUDUUDUgudu7

Solution (in JAVA):

Solution:


import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.util.*;



import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.util.*;

public class vac {
	
	static void swap(int n, int m){
		int temp = n;
		n = m;
		m = temp;
		
		
	}
	static int binarySearch(int arr[], int l, int r, int x) 
    { 
        if (r >= l) { 
            int mid = l + (r - l) / 2; 
  
            // If the element is present at the 
            // middle itself 
            if (arr[mid] == x) 
                return 1; 
  
            // If element is smaller than mid, then 
            // it can only be present in left subarray 
            if (arr[mid] > x) 
                return binarySearch(arr, l, mid - 1, x); 
  
            // Else the element can only be present 
            // in right subarray 
            return binarySearch(arr, mid + 1, r, x); 
        } 
  
        // We reach here when element is not present 
        // in array 
        return -1; 
    } 
  
	
	static int Next_greater(int a[], int n, int x) 
	{ 
	  
	    // Sort the array 
	   
	
	    int low = 0, high = n - 1, ans = x + 1; 
	  
	    // Continue until low is less 
	    // than or equals to high 
	    while (low <= high) { 
	  
	        // Find mid 
	        int mid = (low + high) / 2; 
	  
	        // If element at mid is less than 
	        // or equals to searching element 
	        if (a[mid] <= ans) { 
	  
	            // If mid is equals 
	            // to searching element 
	            if (a[mid] == ans) { 
	  
	                // Increment searching element 
	                ans++; 
	  
	                // Make high as N - 1 
	                high = n - 1; 
	            } 
	  
	            // Make low as mid + 1 
	            low = mid + 1; 
	        } 
	  
	        // Make high as mid - 1 
	        else
	            high = mid - 1; 
	    } 
	  
	    // Return the next greater element 
	    return ans; 
	} 
	
	public static void main(String[] args) throws IOException{
		
		
		
			
			
			
			
		Reader.init(System.in);
		String t1 = Reader.next();
		String t2 = Reader.next();
		String f = Reader.next();
		
		int e = f.length();
		
		
		TreeMap<String, Integer> tm1 = new TreeMap<String, Integer>();
		TreeMap<String, Integer> tm2 = new TreeMap<String, Integer>();
		TreeMap<Integer, String> tm3 = new TreeMap<Integer, String>();
		TreeMap<Integer, String> tm4 = new TreeMap<Integer, String>();
		
		for(int i = 0;i<26;i++) {
			char a = t1.charAt(i);
			String w = Character.toString(a);
			
			tm1.put(w, i);
			tm3.put(i,w);
		}
	
		
		for(int i = 0;i<26;i++) {
			char a = t2.charAt(i);
			String w = Character.toString(a);
			
			tm2.put(w, i);
			tm4.put(i,w);
		}
		String res = "";
		
		for(int i = 0;i<e;i++) {
			char x = f.charAt(i);
			int c = x;
			if(c>=65&&c<=90 || c>=97 && c<= 122) {
				if(c>=65 && c<=90) {
					int y = c-65;
					int d = 97+y;
					char q = (char)d;
					String q1 = Character.toString(q);
				
					int r = tm1.get(q1);
					String r1 = tm4.get(r);
					char r2 = r1.charAt(0);
					int r3 = r2;
					int y1 = r3- 97;
					int d1 = 65+ y1;
					char r4 = (char) d1;
					String w1 = Character.toString(r4);
					res+=w1;
					
					
				
					
					
				}
				if(c>=97 && c<=122) {
					
					char q = (char)c;
					String q1 = Character.toString(q);
				
					int r = tm1.get(q1);
					String r1 = tm4.get(r);
					res+=r1;
					
					
					
					
				}
			}
			else {
				String d2 = Character.toString(x);
				res+=d2;
			}
			
		}
		System.out.println(res);
	
		
//			char x = 'Z';
//			char y = 'z';
//			int t = x;
//			int r = y;
//			System.out.println(t);
//			System.out.println(r);
//					
			
			
			
			
			
		
		
		
		
		
				
		
		
		
		
			
	
			
			
			
		
		
		
		
		
		
	
		}

	
		
//		Reader.init(System.in);
//		TreeSet<String> str = new TreeSet<String>(); 
//		
//			
//		int n = Reader.nextInt();
//		int m = Reader.nextInt();
//		String s1[] = new String[n];
//		
//		for(int j = 0;j<n;j++) {
//			String s = Reader.next();
//			str.add(s);
//			s1[j]=s;
//			
//		}
//		TreeSet<String> str2 = new TreeSet<String>(); 
//		
//		
//		for(int j = 0;j<n;j++)
//		{		
//			
//			StringBuilder a = new StringBuilder(s1[j]);
//			a.reverse();
//			String w = a.toString();
//			if(str.contains(w)&& !w.equals(s1[j])) {
//				StringBuilder a1 = new StringBuilder(s1[j]+w);
//				a1.reverse();
//				String f = a1.toString();
//				if(!str2.contains(w+s1[j])) {
//					str2.add(s1[j]+w);
//				}
//				}
//			}
//		
//		String a4 ="";
//		for(int j = 0;j<n;j++)
//		{		
//			
//			StringBuilder a = new StringBuilder(s1[j]);
//			a.reverse();
//			String d = a.toString();
//			if(d.equals(s1[j])) {
//				a4=s1[j];
//				break;
//				
//				
//			}
//				
//			}
//		String new1 = "";
//			
//		Iterator <String> it = str2.iterator();
//		while(it.hasNext()) {
//			new1+= it.next().substring(0,m);
//			
//		}
//		String new2 = "";
//		
//		Iterator <String> it2 = str2.descendingIterator();
//		while(it2.hasNext()) {
//			new2+= it2.next().substring(m,2*m);
//			
//		}
//		System.out.println((new1+a4+new2).length());
//		
//		System.out.println(new1+a4+new2);
		
		
		
		
		
		
				
				
	
			
			
		
		
			
			  
			
				
			
			
			
			
			
			
			
			
			
		
//			
			
		
			
		

	    

}
	


class Reader {
    static BufferedReader reader;
    static StringTokenizer tokenizer;

   
    static void init(InputStream input) {
        reader = new BufferedReader(
                     new InputStreamReader(input) );
        tokenizer = new StringTokenizer("");
    }

 
    static String next() throws IOException {
        while ( ! tokenizer.hasMoreTokens() ) {
     
            tokenizer = new StringTokenizer(
                   reader.readLine() );
        }
        return tokenizer.nextToken();
    }

    static int nextInt() throws IOException {
        return Integer.parseInt( next() );
    }
	
    static double nextDouble() throws IOException {
        return Double.parseDouble( next() );
    }
    static long nextLong() throws IOException {
        return Long.parseLong( next() );
    }
}