#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  string s1, s2;
  map<char, int> m;
  cin >> s1;
  for (int i = 0; i < s1.length(); i++) {
    m[s1[i]] = i;
  }
  cin >> s2;
  string str;
  cin >> str;
  char arr[str.length()];
  int val2;
  for (int i = 0; i < str.length(); i++) {
    int val = int(str[i]);
    if (val <= 90 && val >= 65) {
      val2 = 32;
      val = val + 32;
    } else {
      val2 = 0;
    }
    if (m.find(char(val)) != m.end()) {
      arr[i] = char(int(s2[m[char(val)]]) - val2);
    } else {
      arr[i] = str[i];
    }
  }
  for (int i = 0; i < str.length(); i++) {
    cout << arr[i];
  }
  return 0;
}
