#include <bits/stdc++.h>
long long int factorial(int n) {
  long long int a[n + 1];
  a[0] = 1;
  int i;
  for (i = 1; i <= n; i++) {
    a[i] = a[i - 1] * i;
  }
  return a[n];
}
int cmp(const void *a, const void *b) { return *(int *)b - *(int *)a; }
int min(int a, int b) { return (a > b ? b : a); }
int max(int a, int b) { return (a < b ? b : a); }
int main() {
  int n, m, i, j;
  char str1[26], str2[26], inp[1007];
  scanf("%s", str1);
  scanf("%s", str2);
  scanf("%s", inp);
  int l = strlen(inp);
  for (i = 0; i < l; i++) {
    if ((inp[i] >= 65 && inp[i] <= 90) || (inp[i] >= 97 && inp[i] <= 122)) {
      for (j = 0; j < 26; j++) {
        if (inp[i] == str1[j] || inp[i] == str1[j] - 32) {
          break;
        }
      }
      if (inp[i] >= 65 && inp[i] <= 90) {
        inp[i] = str2[j] - 32;
      } else {
        inp[i] = str2[j];
      }
    }
  }
  printf("%s\n", inp);
  return 0;
}
