#include <bits/stdc++.h>
using namespace std;
string s1, s2;
string s3;
int find(string aa, char c) {
  for (int i = 0; i < aa.size(); i++) {
    if (aa[i] == c) return i;
  }
  return -1;
}
int main() {
  cin >> s1 >> s2 >> s3;
  for (int i = 0; i < s3.size(); i++) {
    char c = s3[i];
    if ('A' <= c && c <= 'Z') {
      c = c - 'A' + 'a';
      int ind = find(s1, c);
      printf("%c", s2[ind] - 'a' + 'A');
    } else if ('a' <= c && c <= 'z') {
      int ind = find(s1, c);
      printf("%c", s2[ind]);
    } else
      printf("%c", c);
  }
}
