b = "" a = input("Enter the string:") A = list(a) b = A[-1] A[-1] = A[0] A[0] = b for element in A: print(element, end = "")