num = input() ans = [] for i in range(len(num)): x = (int(num[i])+3) % 9 ans.append(x) def swap(list, i, j): temp = list[i] list[i] = list[j] list[j] = temp swap(ans,0,2) swap(ans,1,3) print(f"{ans[0]}{ans[1]}{ans[2]}{ans[3]}")