#include <bits/stdc++.h>
void change(char *f, char *s, char &s1, char &s2) {
  for (int i = 0; i < 26; i++) {
    if (f[i] == s1) {
      s2 = s[i];
      return;
    }
  }
}
int main() {
  char f[1001], s[1001], s3[1001], s4[1001];
  scanf("%s\n%s\n%s", f, s, s3);
  for (int i = 0; s3[i]; i++) {
    if (isdigit(s3[i]))
      s4[i] = s3[i];
    else {
      if (isupper(s3[i])) {
        s3[i] = tolower(s3[i]);
        change(f, s, s3[i], s4[i]);
        s4[i] = toupper(s4[i]);
      } else
        change(f, s, s3[i], s4[i]);
    }
  }
  s4[strlen(s3)] = '\0';
  printf("%s", s4);
  return 0;
}
