def f(s,a1,a2,a3,a4): if (a1 not in s) and (a3 not in s): return s if a1 in s: s = s.replace(a1,a2) if a3 in s: s = s.replace(a3,a4) return f(s,a1,a2,a3,a4) dummy,a1,a2,a3,a4 = input().split() s = input() print(f(s,a1,a2,a3,a4))