#include <bits/stdc++.h>
using namespace std;
int main() {
  char key1[26];
  char key2[26];
  map<char, char> keyboard;
  for (int i = 0; i < 26; i++) {
    cin >> key1[i];
  }
  for (int i = 0; i < 26; i++) {
    cin >> key2[i];
  }
  for (int i = 0; i < 26; i++) {
    keyboard[key1[i]] = key2[i];
  }
  string phrase;
  cin >> phrase;
  for (int i = 0; i < phrase.length(); i++) {
    char c = phrase[i];
    if (isalpha(c)) {
      if (isupper(c)) {
        cout << (char)toupper(keyboard[tolower(c)]);
      } else {
        cout << keyboard[c];
      }
    } else {
      cout << c;
    }
  }
}
