#include <bits/stdc++.h>
using namespace std;
long long gcd(long long a, long long b) {
  if (b == 0)
    return a;
  else
    return gcd(b, a % b);
}
int main() {
  string a, b, s;
  cin >> a >> b >> s;
  for (int i = 0; i < s.length(); ++i) {
    char c = s[i];
    if (c > 64 && c < 91) {
      char t = b[a.find(c + 32)] - 32;
      cout << t;
    } else if (c > 96 && c < 123)
      cout << b[a.find(c)];
    else
      cout << c;
  }
}
