#include <bits/stdc++.h>
using namespace std;
vector<int> v;
string low(string s) {
  int size = s.size();
  for (int i = 0; i < size; i++) {
    if (s[i] >= 65 && s[i] <= 90) {
      s[i] += 32;
      v.push_back(i);
    }
  }
  return s;
}
char up(char r) {
  r -= 32;
  return r;
}
int main() {
  string s, t, r;
  cin >> s >> t >> r;
  r = low(r);
  for (int i = 0; i < r.size(); i++) {
    for (int j = 0; j < 26; j++) {
      if (r[i] == s[j]) {
        r[i] = t[j];
        break;
      }
    }
  }
  for (int j = 0; j < v.size(); j++) {
    r[v[j]] = up(r[v[j]]);
  }
  cout << r << endl;
  return 0;
}
