#include <bits/stdc++.h>
using namespace std;
void _main();
int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  _main();
  return 0;
}
void _main() {
  string fl, sl, s;
  cin >> fl >> sl >> s;
  map<char, char> t;
  for (__typeof(26) i = (0) - ((0) > (26)); i != (26) - ((0) > (26));
       i += 1 - 2 * ((0) > (26))) {
    t.insert(pair<char, char>(fl[i], sl[i]));
  }
  for (auto& it : s) {
    if (islower(it)) {
      char y = tolower(t.at(it));
      cout << y;
    } else if (isupper(it)) {
      char y = toupper(t.at(tolower(it)));
      cout << y;
    } else
      cout << it;
  }
}
