#include <bits/stdc++.h>
using namespace std;
int main() {
  string s1, s2, s3;
  cin >> s1 >> s2 >> s3;
  for (int i = 0; i < s3.length(); i++) {
    if (s3[i] >= 'a' && s3[i] <= 'z') {
      for (int j = 0; j < 26; j++) {
        if (s3[i] == s1[j]) {
          s3[i] = s2[j];
          break;
        }
      }
    }
    if (s3[i] >= 'A' && s3[i] <= 'Z') {
      for (int j = 0; j < 26; j++) {
        if (tolower(s3[i]) == s1[j]) {
          s3[i] = toupper(s2[j]);
          break;
        }
      }
    }
  }
  cout << s3;
  return 0;
}
