n = int(input()) m = 0 while n > 0: digit = n % 10 # 用餘數拿出個位數 m = m * 10 + digit # 原本的數字左移一位,加上新數字 n = n // 10 # 用整數除法去掉個位數 print(m)