#include <bits/stdc++.h>
using namespace std;
inline int Int() {
  int x;
  cin >> x;
  return x;
}
inline long long Long() {
  long long x;
  cin >> x;
  return x;
}
inline float Float() {
  float x;
  cin >> x;
  return x;
}
inline double Double() {
  double x;
  cin >> x;
  return x;
}
inline void Yes() { cout << "Yes" << endl; }
inline void No() { cout << "No" << endl; }
inline void YES() { cout << "YES" << endl; }
inline void NO() { cout << "NO" << endl; }
const int N = (int)2e5 + 5;
const int maxN = (int)1e6 + 6;
const long long Mod = (long long)1e9 + 7;
const int inf = (int)2e9;
const long long Inf = (long long)1e18;
int main() {
  string s1, s2, s3;
  cin >> s1 >> s2 >> s3;
  long long i, j;
  for (i = 0; i < s3.size(); i++) {
    if (s3[i] >= 'A' && s3[i] <= 'Z') {
      char x = s3[i] + 32, y;
      for (j = 0; j < 26; j++) {
        if (x == s1[j]) {
          y = s2[j] - 32;
          cout << y;
          break;
        }
      }
    } else if (s3[i] >= 'a' && s3[i] <= 'z') {
      for (j = 0; j < 26; j++) {
        if (s3[i] == s1[j]) {
          cout << s2[j];
          break;
        }
      }
    } else
      cout << s3[i];
  }
  cout << endl;
  return 0;
}
