#include <bits/stdc++.h>
using namespace std;
int main() {
  map<char, char> hash;
  string s1, s2, s3;
  long long int i, x;
  cin >> s1;
  cin >> s2;
  for (i = 0; i < s1.length(); i++) hash[s1[i]] = s2[i];
  cin >> s3;
  x = s3.length();
  char s4[x];
  for (i = 0; i < x; i++) {
    if (isupper(s3[i])) {
      s4[i] = toupper(hash[tolower(s3[i])]);
    } else if (islower(s3[i])) {
      s4[i] = hash[s3[i]];
    } else
      s4[i] = s3[i];
  }
  for (i = 0; i < x; i++) cout << s4[i];
}
