#include <bits/stdc++.h>
using namespace std;
long long int power(long long int a, long long int b, long long int m) {
  if (b == 0) return (1);
  long long int sol = power(a, b / 2, m);
  sol = (sol * sol) % m;
  if (b % 2 == 1) sol = (sol * a) % m;
  return sol;
}
long long int gcd(long long int a, long long int b) {
  if (b == 0)
    return a;
  else {
    return gcd(b, a % b);
  }
}
map<char, char> m;
void solve() {
  string a, b, s;
  cin >> a >> b >> s;
  for (int i = 0; i < 26; i++) {
    m[a[i]] = b[i];
    m[toupper(a[i])] = toupper(b[i]);
  }
  for (int i = 0; i < s.length(); i++) {
    if (s[i] >= 'a' && s[i] <= 'z') {
      cout << m[s[i]];
      continue;
    }
    if (s[i] >= 'A' && s[i] <= 'Z') {
      cout << m[s[i]];
      continue;
    }
    cout << s[i];
  }
}
int main() {
  int t = 1;
  while (t--) solve();
}
