#include <bits/stdc++.h>
using namespace std;
int main() {
  string a, b, t;
  cin >> a >> b >> t;
  map<char, char> m;
  for (int i = 0; i < 26; i++) {
    m[a[i]] = b[i];
    m[toupper(a[i])] = toupper(b[i]);
  }
  for (char c : t) {
    if (m[c])
      cout << m[c];
    else
      cout << c;
  }
}
