#include <bits/stdc++.h>
using namespace std;
const double PI = 3.141592654;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(NULL), cout.tie(NULL);
  string s, ss, f;
  int a = 0;
  cin >> s >> ss >> f;
  char x;
  for (long long(i) = 0; (i) < (long long)(f.size()); (i)++) {
    if (isalpha(f[i])) {
      if (isupper(f[i])) {
        a = 1;
        f[i] += 32;
      }
      for (long long(j) = 0; (j) < (long long)(s.size()); (j)++) {
        if (f[i] == s[j]) {
          if (a == 0) {
            cout << ss[j];
          } else if (a == 1) {
            x = ss[j];
            x -= 32;
            cout << x;
            a = 0;
          }
          break;
        }
      }
    } else {
      cout << f[i];
    }
  }
  cout << endl;
  return 0;
}
