#include <bits/stdc++.h>
using namespace std;
int main(int argc, char const *argv[]) {
  char s1[30], s2[30], s3[100000];
  int mp[30], x;
  scanf("%s", s1);
  scanf("%s", s2);
  scanf("%s", s3);
  for (int i = 0; i < 26; i++) {
    x = s1[i] - 'a';
    mp[x] = s2[i] - 'a';
  }
  for (int i = 0; i < strlen(s3); i++) {
    if (s3[i] >= 'a' && s3[i] <= 'z') {
      x = s3[i] - 'a';
      printf("%c", 'a' + mp[x]);
    } else if (s3[i] >= 'A' && s3[i] <= 'Z') {
      x = s3[i] - 'A';
      printf("%c", 'A' + mp[x]);
    } else
      printf("%c", s3[i]);
  }
  printf("\n");
  return 0;
}
