#include <bits/stdc++.h>
using namespace std;
vector<int> v(256, 0);
int main() {
  string s1, s2, s;
  cin >> s1 >> s2 >> s;
  int len = s.length();
  for (int i = 0; i < 26; i++) {
    v[s1[i]] = i;
    v[s1[i] - 32] = i;
  }
  for (int j = 0; j < len; j++) {
    if (s[j] >= 65 && s[j] <= 90)
      cout << char(s2[v[s[j]]] - 32);
    else if (s[j] >= 97 && s[j] <= 122)
      cout << s2[v[s[j]]];
    else
      cout << s[j];
  }
  return 0;
}
