#include <bits/stdc++.h>
using namespace std;
string a, b;
char str[1001], result[1001];
int main() {
  cin >> a >> b >> str;
  int len = strlen(str);
  int index = 0;
  for (int i = 0; i < len; i++) {
    int pos = a.find(tolower(str[i]));
    if (pos == -1)
      result[index++] = str[i];
    else {
      if (isupper(str[i]))
        result[index++] = toupper(b[pos]);
      else
        result[index++] = b[pos];
    }
  }
  cout << result << endl;
}
