#include <bits/stdc++.h>
using namespace std;
long long int sumOfDigit(int x) {
  int res = 0;
  while (x) {
    res += x % 10;
    x /= 10;
  }
  return res;
}
long long int gcd(int a, int b) { return b == 0 ? a : gcd(b, a % b); }
void printVec(vector<long long int> v) {
  long long int l = v.size();
  for (int i = 0; i < l; i++) cout << v[i] << " ";
}
int main() {
  string s1, s2, s3;
  cin >> s1 >> s2 >> s3;
  unordered_map<char, char> m;
  for (int i = 0; i < 26; i++) {
    m.insert(make_pair(s1[i], s2[i]));
  }
  for (int i = 0; i < s3.size(); i++) {
    if (65 <= s3[i] && s3[i] <= 90) {
      cout << (char(m[s3[i] + 32] - 32));
    } else if (97 <= s3[i] && s3[i] <= 122)
      cout << m[s3[i]];
    else
      cout << s3[i];
  }
  return 0;
}
