#include <bits/stdc++.h>
using namespace std;
int main() {
  char ch1[26];
  char ch2[26];
  memset(ch1, '0', sizeof(ch1));
  for (int i = 0; i < 26; i++) {
    cin >> ch2[i];
  }
  for (int i = 0; i < 26; i++) {
    char ch;
    cin >> ch;
    ch1[ch2[i] - 'a'] = ch;
  }
  string s;
  cin >> s;
  int flag = 0;
  for (int i = 0; i < s.length(); i++) {
    flag = 0;
    if (s[i] >= '0' && s[i] <= '9')
      cout << s[i];
    else {
      if (s[i] >= 'A' && s[i] <= 'Z') {
        flag = 1;
        s[i] = s[i] + 32;
      }
      if (flag == 1)
        cout << (char)(ch1[s[i] - 'a'] - 32);
      else
        cout << (char)(ch1[s[i] - 'a']);
    }
  }
  cout << endl;
}
