#include <bits/stdc++.h>
using namespace std;
string f(string s) {
  reverse(s.begin(), s.end());
  return s;
}
int sk(string s) {
  int res = 0;
  for (int i = 0; i < s.length(); i++) {
    res *= 10;
    res += (s[i] - '0');
  }
  return res;
}
int main() {
  string s, ss, x;
  cin >> s >> ss >> x;
  map<char, char> mp;
  for (int i = 0; i < s.length(); i++) {
    mp[s[i]] = ss[i];
    mp[toupper(s[i])] = toupper(ss[i]);
  }
  for (int i = 0; i < x.length(); i++) {
    if (x[i] >= '0' && x[i] <= '9')
      cout << x[i];
    else
      cout << mp[x[i]];
  }
  return 0;
}
