#include <bits/stdc++.h>
using namespace std;
void solve() {
  string a, b, c;
  cin >> a >> b >> c;
  for (long long i = 0; i < c.size(); i++) {
    if (isupper(c[i])) {
      char tempChar = tolower(c[i]);
      auto it = find(a.begin(), a.end(), tempChar);
      long long len = distance(a.begin(), it);
      char cher = toupper(b[len]);
      cout << cher;
    } else if (islower(c[i])) {
      auto it = find(a.begin(), a.end(), c[i]);
      long long len = distance(a.begin(), it);
      cout << b[len];
    } else {
      cout << c[i];
    }
  }
}
int32_t main() {
  cin.tie(nullptr)->sync_with_stdio(false);
  long long T(1);
  while (T--) {
    solve();
  }
  return 0;
}
