#include <bits/stdc++.h>
using namespace std;
int main() {
  string a, b, c;
  char arr[26];
  cin >> a;
  cin >> b;
  cin >> c;
  for (int i = 0; i < 26; i++) {
    if (a[i] > 96) arr[a[i] - 97] = b[i];
  }
  for (int i = 0; i < c.size(); i++) {
    if (c[i] > 96) {
      cout << arr[c[i] - 97];
    } else if (c[i] > 64) {
      char k = arr[c[i] + 32 - 97];
      k = k - 32;
      cout << k;
    } else
      cout << c[i];
  }
}
