#include <bits/stdc++.h>
using namespace std;
int main() {
  string s, a, b;
  char c;
  int i, j, n, m, t;
  cin >> a >> b >> s;
  n = s.size();
  for (i = 0; i < n; i++) {
    for (j = 0; j < 26; j++) {
      if (s[i] == a[j]) {
        cout << b[j];
        break;
      }
      if (s[i] + 32 == a[j]) {
        c = b[j] - 'a' + 'A';
        cout << c;
        break;
      }
    }
    if (j == 26) cout << s[i];
  }
  cout << endl;
}
