#include <bits/stdc++.h>
using namespace std;
const int INF = (int)1e9;
const long long INFLL = (long long)1e16;
const int MOD = (int)1e9 + 7;
template <typename T>
void out(T x) {
  cout << x << endl;
  exit(0);
}
bool bysec(const pair<int, int> &a, const pair<int, int> &b) {
  return a.second < b.second;
}
const int maxn = (int)1e5 + 5;
string s, t, inp;
map<char, char> fn;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cin >> s;
  cin >> t;
  for (int i = 0; i < 26; i++) fn[s[i]] = t[i];
  cin >> inp;
  for (int i = 0; i < inp.length(); i++) {
    char c = inp[i];
    if (c >= '0' && c <= '9') {
      cout << c;
    } else if (c >= 'A' && c <= 'Z') {
      cout << (char)(fn[c - 'A' + 'a'] - 'a' + 'A');
    } else {
      cout << fn[c];
    }
  }
  cout << endl;
  return 0;
}
