Problem:


Score : 100 points

Problem Statement

You are given a string S of length 2 or 3 consisting of lowercase English letters. If the length of the string is 2, print it as is; if the length is 3, print the string after reversing it.

Constraints

The length of S is 2 or 3.

S consists of lowercase English letters.

Input

Input is given from Standard Input in the following format:

S

Output

If the length of S is 2, print S as is; if the length is 3, print S after reversing it.

Sample Input 1

abc

Sample Output 1

cba

As the length of S is 3, we print it after reversing it.

Sample Input 2

ac

Sample Output 2

ac

As the length of S is 2, we print it as is.



Sample input:
abc


Sample output:
cba

Submission status: Wrong Answer

Solution code:
s = list(input())
if len(s) == 2:
    print(s)
else:
    print("".join(s[::-1]))

Submission status: Wrong Answer

Solution code:
import sys

read = sys.stdin.read
readline = sys.stdin.buffer.readline
sys.setrecursionlimit(10 ** 8)
INF = float('inf')
MOD = 10 ** 9 + 7


def main():
    S = input()
    print(''.join(list(reversed(S))))


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
s=input()
if len(s)==3:
  s=sorted(s)
print(s)

Submission status: Wrong Answer

Solution code:
print(input()[::-1])

Submission status: Wrong Answer

Solution code:
s = input()
print(s if len(s)==2 else reversed(s))

Submission status: Wrong Answer

Solution code:
s=input()
if len(s) == 2:
  print(s)
else:
  print(reversed(s))

Submission status: Wrong Answer

Solution code:
a = input()
if len(a) == 2:
  print(a)
else:
  new_str = ''.join(list(reversed(a)))

Submission status: Wrong Answer

Solution code:
s = input()

if len(s) == 3:
    print(reversed(s))
else:
    print(s)

Submission status: Wrong Answer

Solution code:
s = input()

if len(s)==2:
	print(s)
else:
	s = list(s)
	s.reverse
	print("".join(s))

Submission status: Wrong Answer

Solution code:
s = input()

if len(s)==2:
	print(s)
else:
	s = list(s)
	s.sort(reverse=True)
	print("".join(s))

Submission status: Wrong Answer

Solution code:
S=input()

if len(S)==2:
    print(S)
else:
    print(list(reversed(S)))

Submission status: Wrong Answer

Solution code:
S = input()
if len(S) == 2:
    print(S)
else:
    print(reversed(S))

Submission status: Wrong Answer

Solution code:
s=list(input())
ans=''
if len(s)==2:
    print(','.join(s))
else:
    tmp=s[0]
    s[0]=s[2]
    s[2]=tmp
    print(','.join(s))

Submission status: Wrong Answer

Solution code:
s = input()
if len(s) <= 2:
  print(s)
else :
  for i in reversed(s):
    print(i)

Submission status: Wrong Answer

Solution code:
s = list(input())

if len(s) == 3:
    s.sort(reverse=True)

print(*s, sep='')

Submission status: Wrong Answer

Solution code:
###template###
import sys
input = sys.stdin.readline
def mi(): return map(int, input().split())
###template###

s = input()

if len(s)==2: print(s)
else: print(s[::-1])

Submission status: Wrong Answer

Solution code:
a=input()
print(a[::1-2*len(a)&1])

Submission status: Wrong Answer

Solution code:
S = input().split()

if len(S) == 2:
    print(S)
elif len(S) == 3:
    print(S[::-1])

Submission status: Wrong Answer

Solution code:
print(input()[::-1].upper())

Submission status: Wrong Answer

Solution code:
import sys
input = sys.stdin.readline
def ii(): return int(input())
def mi(): return map(int, input().rstrip().split())
def lmi(): return list(map(int, input().rstrip().split()))
def li(): return list(input().rstrip())
# template


S = input()
if len(S) == 2:
    print(S)
else:
    list(S).reverse()
    print(''.join(S))

Submission status: Wrong Answer

Solution code:
0

Submission status: Wrong Answer

Solution code:
S = list(str(input()))
if len(S) == 2:
  print(S[0],S[1])
else:
  print(S[2],S[1],S[0])

Submission status: Wrong Answer

Solution code:
s=input()
if len(s)==2:
  print(s)
else:
  print(reversed(s))

Submission status: Wrong Answer

Solution code:
s=input()
if len(s)==2:
  print(s)
else:
  print(reversed(s))

Submission status: Wrong Answer

Solution code:
S=input()
if len(S)==2:
    print(S)
else:
    print(reversed(S))

Submission status: Wrong Answer

Solution code:
import sys

s = sys.stdin.read().lstrip()
if len(s) % 2 == 1:
    s = s[::-1]
print(s)

Submission status: Wrong Answer

Solution code:
import sys


def main(arg):
    #  print(arg)
    for i in arg:

        if len(i) == 2:
            print(i)
        elif len(i) == 3:
            print(i[::-1])


if __name__ == '__main__':
    main(sys.argv[1:])

Submission status: Wrong Answer

Solution code:
A = input()
if len(A) == 2:
  print(A)
else:
  print(reversed(A))

Submission status: Wrong Answer

Solution code:
s = input()
n = len(s)
if (n == 3):
	for i in range(n):
		print(s[n-i-1],end = "")
		print()
print(s)

Submission status: Wrong Answer

Solution code:
S = input()

print(S if len(S) == 2 else S[-1])

Submission status: Wrong Answer

Solution code:
import sys

def solve(S):
    x = S
    if len(S) == 2:
        return S
    elif len(S) == 3 :
        return x[2] + x[1] + x[0]

def readQuestion():
    ws = sys.stdin.readline().strip().split()
    S = int(ws[0])
    return (S)

def main():
    print(solve(*readQuestion()))

# Uncomment before submission
# main()

Submission status: Wrong Answer

Solution code:
a=input()
print(a if len(a)==2 else reversed(a))

Submission status: Wrong Answer

Solution code:
s = input()

if s.__len__() == 3:
    print(s[::-1])

Submission status: Wrong Answer

Solution code:
s = input()

if ( s.__len__() == 3):
    print(s[::-1])

Submission status: Wrong Answer

Solution code:
S = input()
if len(S) == 2:
	print(type(S))
else:
	S = S[::-1]
	print(type(S))

Submission status: Wrong Answer

Solution code:
S = input()
T = ''
if len(S) == 2:
    T = S[1] + S[0]
else:
    T = S[2] + S[1] + S[0]
print(T)

Submission status: Wrong Answer

Solution code:
s=input();print(s[::-1**len(s)])

Submission status: Wrong Answer

Solution code:
a=list(input())
if len(a) == 3:
  print(str(a[::-1]))
else:
  print(str(a))

Submission status: Wrong Answer

Solution code:
import sys

params = sys.argv
length = len(params)

# print(params)
# print(params[1][2])
if length == 3:

    print(params[1][2])
    print(params[1][1])
    print(params[1][0])

elif length == 2:
    print(sys.argv[1])

Submission status: Wrong Answer

Solution code:
S = input()
S_len = len(S)
S_list = list(S)
ans = ''

if S_len == 2:
    print(S)

elif S_len == 3:
    S_reverse = sorted(S, reverse=True)
    for i in range(S_len):
        ans += S_reverse[i]
    print(ans)

Submission status: Wrong Answer

Solution code:
a = input("input character")
if len(a) == 2:
    print(a)
else:
    a_inv = a[::-1]
    print(a_inv)

Submission status: Wrong Answer

Solution code:
# coding: utf-8

s = input().strip()
if len(s) == 2:
    print(s)
else:
    for c in s:
        print(c, end="")
    print()

Submission status: Wrong Answer

Solution code:
S = input()
if len(S) == 2:
    print(S)
print(S[::-1])

Submission status: Wrong Answer

Solution code:
a=input()
a=list(a)
n=len(a)
if(n==2):
 print(a)
else:
 print(a[2]+a[1]+a[0])

Submission status: Wrong Answer

Solution code:
S = input()[::-1]
if len(S) == 2:
    print(S)
print(S[::-1])

Submission status: Wrong Answer

Solution code:
s = input()
if len(s) == 2:
    s = s[::-1]
print(s)

Submission status: Wrong Answer

Solution code:
a = input()
print(str(sorted(a,reverse=True)) if len(a) == 3 else a)

Submission status: Wrong Answer

Solution code:
a = input()
print(str(sorted(a,reverse=True)) if len(a) > 2 else a)

Submission status: Wrong Answer

Solution code:
def main():
    x = list(input())
    x.reverse()
    print("".join(x))

if __name__ == "__main__":
    main()

Submission status: Wrong Answer

Solution code:
a = list(input())

if len(a) == 2:
    print(a)
else:
    a.reverse()
    a = "".join(a)
    print(a)

Submission status: Wrong Answer

Solution code:
S = input()
if len(S)==2:
    print(S)
else:
    print(reversed(S))

Submission status: Wrong Answer

Solution code:
#JMD
#Nagendra Jha-4096

 
import sys
import math

#import fractions
#import numpy
 
###File Operations###
fileoperation=0
if(fileoperation):
    orig_stdout = sys.stdout
    orig_stdin = sys.stdin
    inputfile = open('W:/Competitive Programming/input.txt', 'r')
    outputfile = open('W:/Competitive Programming/output.txt', 'w')
    sys.stdin = inputfile
    sys.stdout = outputfile

###Defines...###
mod=1000000007
 
###FUF's...###
def nospace(l):
    ans=''.join(str(i) for i in l)
    return ans
 
 
 
##### Main ####
s=str(input())
if(len(s)==2):
    print(2)
else:
    print(s[::-1])
    
    
#####File Operations#####
if(fileoperation):
    sys.stdout = orig_stdout
    sys.stdin = orig_stdin
    inputfile.close()
    outputfile.close()

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-
s = list(input())

if len(s)==2:
    print("".join(s))
else:
    print("".join(sorted(s,reverse=True)))

Submission status: Wrong Answer

Solution code:
def tpbc_2018_a():
    import sys
    input = sys.stdin.readline

    s = input()
    if len(s) == 2:
        return s
    else:
        return s[::-1]


print(tpbc_2018_a())

Submission status: Wrong Answer

Solution code:
a = list(input())

if len(a) == 2:
    print(a)
else:
    a.reverse()
    print(a)

Submission status: Accepted

Solution code:
S = input().rstrip('\n')
if len(S) == 2:
    print(S)
else:
    print(S[::-1])

Submission status: Accepted

Solution code:
S = input()
if len(S) == 2:
  print(S)
else:
  print(S[::-1])

Submission status: Accepted

Solution code:
S = input()
if len(S) == 2:
  print(S)
else:
  for i in range(len(S)):
    print(S[len(S) - i - 1],end = "")

Submission status: Accepted

Solution code:
s=input()
if len(s)==2:
  print(s)
else:
  print(s[::-1])

Submission status: Accepted

Solution code:
S = input()
print([S,S[::-1]][len(S)==3])

Submission status: Accepted

Solution code:
s = input()
if len(s) == 2:
  print(s)
else:
  print(s[2]+s[1]+s[0])

Submission status: Accepted

Solution code:
s=input()
n=len(s)
print([s[-1]+s[1]+s[0],s][n==2])

Submission status: Accepted

Solution code:
s = input()
if len(s) == 2:
    print(s)
else:
    for i in range(len(s)-1, -1, -1):
        print(s[i], end="")

Submission status: Accepted

Solution code:
S = input()
N = len(S)
ans = S if N == 2 else S[::-1]
print(ans)

Submission status: Accepted

Solution code:
s=input()

if len(s)==2:
  print(s)
if len(s)==3:
  ss = s[::-1]
  print(ss)

Submission status: Accepted

Solution code:
s = input()
print(s if len(s) == 2 else s[2]+s[1]+s[0])

Submission status: Accepted

Solution code:
n = input()
if len(n)==2:
    print(n)
else:
    print(n[::-1])

Submission status: Accepted

Solution code:
from sys import stdin
rs = lambda : stdin.readline().strip()
ri = lambda : int(rs())
ril = lambda : list(map(int, rs().split()))

def main():
    s = rs()
    if len(s) == 2:
        print(s)
    else:
        print(s[::-1])

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
s=list(input())
if len(s)==3:
    s=reversed(s)
print("".join(s))

Submission status: Accepted

Solution code:
a = input()

if len(a) % 2 == 0:
    print(a)
else:
    print(a[::-1])

Submission status: Accepted

Solution code:
s = list(input())
if len(s) == 2:
    print("".join(s))
else:
    print("".join(s[::-1]))

Submission status: Accepted

Solution code:
a = input()
if len(a) == 2:
    print(a)
else:
    print(a[2]+a[1]+a[0])

Submission status: Accepted

Solution code:
# import math
# import statistics
a=input()
#b,c=int(input()),int(input())
c=[]
for i in a:
    c.append(i)
#e1,e2 = map(int,input().split())
#f = list(map(int,input().split()))
#g = [input() for _ in range(a)]

if len(c)==2:
    print(a)
elif len(c)==3:
    c.reverse()
    print("".join(c))

Submission status: Accepted

Solution code:
s = str(input())
if len(s) == 2:
    print(s)
else:
    print(s[::-1])

Submission status: Accepted

Solution code:
s = input()
print(s if len(s) == 2 else s[::-1])

Submission status: Accepted

Solution code:
a=input()
if len(a)==3:
    print(a[::-1])
else:
    print(a)

Submission status: Accepted

Solution code:
s = input()
if len(s) == 2:
    print(s)
else:
    print(s[::-1])

Submission status: Accepted

Solution code:
S=input()
if len(S)==2:
    print(S)
else:
    print(S[::-1])

Submission status: Accepted

Solution code:
S=input()

if len(S)==2:
  print(S)
else:
  print(S[::-1])

Submission status: Accepted

Solution code:
import sys

readline = sys.stdin.readline
MOD = 10 ** 9 + 7
INF = float('INF')
sys.setrecursionlimit(10 ** 5)


def main():
    S = input()

    if len(S) == 3:
        print(S[::-1])
    else:
        print(S)


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
def main():
    s = input()
    if len(s) == 2:
        print(s)
    else:
        print(s[::-1])


if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
import sys
def input():
    return sys.stdin.readline()[:-1]

def main():
    S = input()

    T = S
    if len(S) == 3:
        T = ''
        for i in range(3):
            T += S[2 - i]
    print(T)

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
from collections import defaultdict, Counter
from itertools import product, groupby, count, permutations, combinations
from math import pi, sqrt
from collections import deque
from bisect import bisect, bisect_left, bisect_right
from string import ascii_lowercase
from functools import lru_cache
import sys
sys.setrecursionlimit(10000)
INF = float("inf")
YES, Yes, yes, NO, No, no = "YES", "Yes", "yes", "NO", "No", "no"
dy4, dx4 = [0, 1, 0, -1], [1, 0, -1, 0]
dy8, dx8 = [0, -1, 0, 1, 1, -1, -1, 1], [1, 0, -1, 0, 1, 1, -1, -1]


def inside(y, x, H, W):
    return 0 <= y < H and 0 <= x < W


def ceil(a, b):
    return (a + b - 1) // b


def sum_of_arithmetic_progression(s, d, n):
    return n * (2 * s + (n - 1) * d) // 2


def gcd(a, b):
    if b == 0:
        return a
    return gcd(b, a % b)


def lcm(a, b):
    g = gcd(a, b)
    return a / g * b


def solve():
    S = input()
    if len(S) == 3:
        S = S[::-1]
    print(S)


def main():
    solve()


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:

S=str(input())
if len(S)==2:
    print(S)
else:
    print(S[::-1])

Submission status: Accepted

Solution code:
import bisect,collections,copy,heapq,itertools,math,string
import sys
def S(): return sys.stdin.readline().rstrip()
def M(): return map(int,sys.stdin.readline().rstrip().split())
def I(): return int(sys.stdin.readline().rstrip())
def LI(): return list(map(int,sys.stdin.readline().rstrip().split()))
def LS(): return list(sys.stdin.readline().rstrip().split())
s = S()
ans = ''
if len(s) == 3:
    ans = s[::-1]
else:
    ans = s
print(ans)

Submission status: Accepted

Solution code:
s = input()
if len(s) == 2:
    print(s)
else:
    print(s[2]+s[1]+s[0])

Submission status: Accepted

Solution code:
S = input()
if len(S) == 3:
    print(S[::-1])
else:
    print(S)

Submission status: Accepted

Solution code:
# A - Measure
S = input()
if len(S)==2:
    print(S)
else:
    print(S[2]+S[1]+S[0])

Submission status: Accepted

Solution code:
S = input ()
if len(S) == 2:
  print (S)
else:
  print (S[2]+S[1]+S[0])

Submission status: Accepted

Solution code:
s = input()
if len(s) == 3:
    print(s[::-1])
else:
    print(s)

Submission status: Accepted

Solution code:
s = input()
if len(s) == 2:
  print(s)
else:
  print(s[::-1])

Submission status: Accepted

Solution code:
S = input()
if len(S) == 2:
  print(S)
if len(S) == 3:
  print(S[2]+S[1]+S[0])

Submission status: Accepted

Solution code:
s = input()
if len(s) == 2:
    print(s)
else:
    print(s[2] + s[1] + s[0])

Submission status: Accepted

Solution code:
s=input()
print(s if len(s)==2 else s[::-1])

Submission status: Accepted

Solution code:
S = input()
print(S) if len(S) == 2 else print(S[::-1])

Submission status: Accepted

Solution code:
s=input()
if len(s)==2:
    print(s)
else:
    print(s[::-1])

Submission status: Accepted

Solution code:
n = input()
print(n[::-1] if len(n) == 3 else n)

Submission status: Accepted

Solution code:
*S, = input()

if len(S) == 3:
    print(''.join(S[::-1]))
else:
    print(''.join(S))

Submission status: Accepted

Solution code:
def main():
    s = input()
    if len(s) == 2:
        print(s)
    else:
        print(s[::-1])

if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
'''
Created on 2020/08/20

@author: harurun
'''
def main():
  import sys
  pin=sys.stdin.readline
  pout=sys.stdout.write
  perr=sys.stderr.write
  
  S=pin()[:-1]
  if len(S)==2:
    print(S)
    return 
  print(S[::-1])
  return 

main()

Submission status: Accepted

Solution code:
import sys
import math
import itertools
import collections
import heapq
import re
import numpy as np
from functools import reduce

rr = lambda: sys.stdin.readline().rstrip()
rs = lambda: sys.stdin.readline().split()
ri = lambda: int(sys.stdin.readline())
rm = lambda: map(int, sys.stdin.readline().split())
rf = lambda: map(float, sys.stdin.readline().split())
rl = lambda: list(map(int, sys.stdin.readline().split()))
inf = float('inf')
mod = 10**9 + 7

s = rr()
lens = len(s)
if lens == 3:
    print(s[::-1])
else:
    print(s)

Submission status: Accepted

Solution code:
a = input()
if len(a) == 2:
  print(a)
else:
  print(a[::-1])

Submission status: Accepted

Solution code:
#Tenka1 Programmer Beginner Contest a
s=input()
n=len(s)
ans=s
if n==3:
    ans=s[::-1]
print(ans)

Submission status: Accepted

Solution code:
S = input()
print([S, S[::-1]][len(S) % 2])

Submission status: Accepted

Solution code:
a=str(input())
if len(a)==2:
    print(a)
if len(a)==3:
    print(a[2]+a[1]+a[0])

Submission status: Accepted

Solution code:
s = str(input())
if len(s) == 2: print(s)
else: print(s[::-1])

Submission status: Accepted

Solution code:
s = input()
if (len(s) == 2):
    print(s)
elif (len(s) == 3):
    print(s[::-1])

Submission status: Accepted

Solution code:
s = input()
if len(s)==2: print(s)
else: print(s[::-1])

Submission status: Accepted

Solution code:
S = input()
print(S[2]+S[1]+S[0] if len(S)==3 else S)

Submission status: Accepted

Solution code:
s=input()

if len(s) == 2:
	print(s)
else:
	tmps=list(reversed(s))
	print("".join(tmps))

Submission status: Accepted

Solution code:
s = input()
print(s if len(s) == 2 else s[::-1])

Submission status: Accepted

Solution code:
s = input()
if len(s) == 2:
    print(s)
else:
    print(s[::-1])

Submission status: Accepted

Solution code:
s=list(input())
if len(s)==2:
  print(''.join(s))
else:
  print(''.join(reversed(s)))

Submission status: Accepted

Solution code:
import sys

read = sys.stdin.read
readline = sys.stdin.buffer.readline
sys.setrecursionlimit(10 ** 8)
INF = float('inf')
MOD = 10 ** 9 + 7


def main():
    S = input()
    if len(S)==2:
        print(S)
    else:
        print(''.join(list(reversed(S))))


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
s = input()

if len(s) == 3:
    s = s[::-1]

print(s)

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
# encoding:utf-8
import copy
import random
import bisect #bisect_left　これで二部探索の大小検索が行える
import fractions #最小公倍数などはこっち
import math
import sys
import collections
from decimal import Decimal # 10進数で考慮できる

mod = 10**9+7
sys.setrecursionlimit(mod) # 再帰回数上限はでdefault1000

d = collections.deque()
def LI(): return list(map(int, sys.stdin.readline().split()))

S = list(str(input()))

if len(S) == 3:
    S.reverse()

print("".join(S))

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
# encoding:utf-8
import copy
import random
import bisect #bisect_left　これで二部探索の大小検索が行える
import fractions #最小公倍数などはこっち
import math
import sys
import collections
from decimal import Decimal # 10進数で考慮できる

mod = 10**9+7
sys.setrecursionlimit(mod) # 再帰回数上限はでdefault1000

d = collections.deque()
def LI(): return list(map(int, sys.stdin.readline().split()))

S = list(str(input()))
if len(S) == 3:
    S.reverse()

print("".join(S))

Submission status: Accepted

Solution code:
import bisect, collections, copy, heapq, itertools, math, string, sys
input = lambda: sys.stdin.readline().rstrip() 
sys.setrecursionlimit(10**7)
INF = float('inf')
def I(): return int(input())
def F(): return float(input())
def SS(): return input()
def LI(): return [int(x) for x in input().split()]
def LI_(): return [int(x)-1 for x in input().split()]
def LF(): return [float(x) for x in input().split()]
def LSS(): return input().split()

def resolve():
    S = SS()

    if len(S) == 2:
        print(S)
    else:
        print(S[::-1])

if __name__ == '__main__':
    resolve()

Submission status: Accepted

Solution code:
s = input()
if len(s) == 2:
    print(s)
else:
    print(s[2], end="")
    print(s[1], end="")
    print(s[0])

Submission status: Accepted

Solution code:
S = input()
print(S if len(S) == 2 else ''.join(reversed(list(S))))

Submission status: Accepted

Solution code:
s = input()
if len(s) == 2:
  print(s)
else:
  s = list(s)
  s.reverse()
  print(''.join(s))

Submission status: Accepted

Solution code:
s = input()
if len(s) >= 3:
    temp = s
    s = temp[2] + temp[1] + temp[0]
print(s)

Submission status: Accepted

Solution code:
import sys, math
from functools import lru_cache
from collections import deque
sys.setrecursionlimit(500000)
MOD = 10**9+7

def input():
    return sys.stdin.readline()[:-1]

def mi():
    return map(int, input().split())

def ii():
    return int(input())

def i2(n):
    tmp = [list(mi()) for i in range(n)]
    return [list(i) for i in zip(*tmp)]


def main():
    S = input()
    if len(S) == 2:
        print(S)
    else:
        print(S[::-1])


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
s=input()
print(s[::-1] if len(s)-2 else s)

Submission status: Accepted

Solution code:
s = input()
if len(s) == 3:
    s = s[::-1]
print(s)

Submission status: Accepted

Solution code:
S=input()
print(S[::-1] if len(S)==3 else S)

Submission status: Accepted

Solution code:
S = input()
a = 0
if len(S) == 2:
  print(S)
else:
  print(S[2]+S[1]+S[0])

Submission status: Accepted

Solution code:
S=list(input())

if len(S)==2:
  print("".join(S))
else:
  S.reverse()
  print("".join(S))

Submission status: Accepted

Solution code:
import sys

input = sys.stdin.readline


def main():
    S = input().rstrip()

    if len(S) == 2:
        ans = S
    else:
        ans = S[::-1]

    print(ans)


if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import accumulate, permutations, combinations, product, groupby, combinations_with_replacement
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from bisect import bisect, bisect_left
from fractions import gcd
from heapq import heappush, heappop
from functools import reduce
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
def ZIP(n): return zip(*(MAP() for _ in range(n)))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7

S = input()

print(S if len(S)==2 else S[::-1])

Submission status: Accepted

Solution code:
s = input()
print(s if len(s)==2 else s[::-1])

Submission status: Accepted

Solution code:
s = input()
if len(s)==2:
  print(s)
else:
  print(s[::-1])

Submission status: Accepted

Solution code:
s = input()
if len(s) == 3:
  s = s[::-1]
print(s)

Submission status: Accepted

Solution code:
s=input()
if len(s)==3:
  print(s[::-1])
else:
  print(s)

Submission status: Accepted

Solution code:
s=input();print(s if len(s)<3 else s[::-1])

Submission status: Accepted

Solution code:
n =input()
if len(n) == 2:
  print(n)
else:
  print(n[::-1])

Submission status: Accepted

Solution code:
s = input()
n = len(s)
if n == 2:
    print(s)
else:
    print(s[::-1])

Submission status: Accepted

Solution code:
S=input()
print(S[::(-1)**(len(S)%2)])

Submission status: Accepted

Solution code:
s = input()
if len(s) == 2:
  print(s)
elif len(s) == 3:
  print(s[::-1])

Submission status: Accepted

Solution code:
s=input()
if len(s)==3:
  s=s[2]+s[1]+s[0]
print(s)

Submission status: Accepted

Solution code:
# a, b, c = map(int, input().split())
s = input()
if len(s) == 2:
	print(s)
else:
	print(s[::-1])

Submission status: Accepted

Solution code:
S = input()

if len(S) == 2:
    print(S)
else:
    print(S[-1:-len(S)-1:-1])

Submission status: Accepted

Solution code:
s=input()

if len(s)==2:
    print(s)

elif len(s)==3:
    print(s[::-1])

Submission status: Accepted

Solution code:
s=input()
if len(s)==2:
  print(s)
else:
  s=list(reversed(s))
  print(*s,sep="")

Submission status: Accepted

Solution code:
S = input()
ans = S if len(S) == 2 else S[::-1]
print(ans)

Submission status: Accepted

Solution code:
s = input()

if len(s) == 2:
    print(s)
else:
    print(s[2]+s[1]+s[0])

Submission status: Accepted

Solution code:
s=input();print(s[::-1] if len(s)>2 else s)

Submission status: Accepted

Solution code:
#!/usr/bin/env python3

import sys
from typing import Any, Callable, Deque, Dict, List, Mapping, Optional, Sequence, Set, Tuple, TypeVar, Union
# import time
# import math
# import numpy as np
# import scipy.sparse.csgraph as cs            # csgraph_from_dense(ndarray, null_value=inf), bellman_ford(G, return_predecessors=True), dijkstra, floyd_warshall
# import random                                # random, uniform, randint, randrange, shuffle, sample
# import string                                # ascii_lowercase, ascii_uppercase, ascii_letters, digits, hexdigits
# import re                                    # re.compile(pattern) => ptn obj; p.search(s), p.match(s), p.finditer(s) => match obj; p.sub(after, s)
# from bisect import bisect_left, bisect_right # bisect_left(a, x, lo=0, hi=len(a)) returns i such that all(val<x for val in a[lo:i]) and all(val>-=x for val in a[i:hi]).
# from collections import deque                # deque class. deque(L): dq.append(x), dq.appendleft(x), dq.pop(), dq.popleft(), dq.rotate()
# from collections import defaultdict          # subclass of dict. defaultdict(facroty)
# from collections import Counter              # subclass of dict. Counter(iter): c.elements(), c.most_common(n), c.subtract(iter)
# from datetime import date, datetime          # date.today(), date(year,month,day) => date obj; datetime.now(), datetime(year,month,day,hour,second,microsecond) => datetime obj; subtraction => timedelta obj
# from datetime.datetime import strptime       # strptime('2019/01/01 10:05:20', '%Y/%m/%d/ %H:%M:%S') returns datetime obj
# from datetime import timedelta               # td.days, td.seconds, td.microseconds, td.total_seconds(). abs function is also available.
# from copy import copy, deepcopy              # use deepcopy to copy multi-dimentional matrix without reference
# from functools import reduce                 # reduce(f, iter[, init])
# from functools import lru_cache              # @lrucache ...arguments of functions should be able to be keys of dict (e.g. list is not allowed)
# from heapq import heapify, heappush, heappop # built-in list. heapify(L) changes list in-place to min-heap in O(n), heappush(heapL, x) and heappop(heapL) in O(lgn).
# from heapq import nlargest, nsmallest        # nlargest(n, iter[, key]) returns k-largest-list in O(n+klgn).
# from itertools import count, cycle, repeat   # count(start[,step]), cycle(iter), repeat(elm[,n])
# from itertools import groupby                # [(k, list(g)) for k, g in groupby('000112')] returns [('0',['0','0','0']), ('1',['1','1']), ('2',['2'])]
# from itertools import starmap                # starmap(pow, [[2,5], [3,2]]) returns [32, 9]
# from itertools import product, permutations  # product(iter, repeat=n), permutations(iter[,r])
# from itertools import combinations, combinations_with_replacement
# from itertools import accumulate             # accumulate(iter[, f])
# from operator import itemgetter              # itemgetter(1), itemgetter('key')
# from fractions import Fraction               # Fraction(a, b) => a / b ∈ Q. note: Fraction(0.1) do not returns Fraciton(1, 10). Fraction('0.1') returns Fraction(1, 10)



def main():
    mod = 1000000007                # 10^9+7
    inf = float('inf')              # sys.float_info.max = 1.79e+308
    # inf = 2 ** 63 - 1             # (for fast JIT compile in PyPy) 9.22e+18
    sys.setrecursionlimit(10**6)    # 1000 -> 1000000
    def input(): return sys.stdin.readline().rstrip()
    def ii():    return int(input())
    def isp():   return input().split()
    def mi():    return map(int, input().split())
    def mi_0():  return map(lambda x: int(x)-1, input().split())
    def lmi():   return list(map(int, input().split()))
    def lmi_0(): return list(map(lambda x: int(x)-1, input().split()))
    def li():    return list(input())
    
    
    s = input()
    n = len(s)
    print(s) if n == 2 else print(s[::-1])


if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
def main():
    S = input()
    if len(S) == 2:
        print(S)
    else:
        print(S[::-1])


if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, tan, asin, acos, atan, radians, degrees#, log2
from itertools import accumulate, permutations, combinations, combinations_with_replacement, product, groupby
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from bisect import bisect, bisect_left, insort, insort_left
from fractions import gcd
from heapq import heappush, heappop
from functools import reduce
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
def ZIP(n): return zip(*(MAP() for _ in range(n)))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10**9 + 7
#from decimal import *

S = input()

print(S if len(S)== 2 else S[::-1])

Submission status: Accepted

Solution code:
s=input()
if len(s)==3:
    s=s[::-1]
print(s)

Submission status: Accepted

Solution code:


def I(): return int(input())
def MI(): return map(int, input().split())
def LI(): return list(map(int, input().split()))

def main():
    mod=10**9+7
    s=input()
    if len(s)==2:
        print(s)
    else:
        print(s[::-1])

main()

Submission status: Accepted

Solution code:
s = input()

if len(s) == 2:
    print(s)
else:
    print(s[::-1])

Submission status: Accepted

Solution code:
S = input()
if len(S)==2:
  print(S)
else:
  print(S[::-1])

Submission status: Accepted

Solution code:
s = input()

if len(s)%2 == 0:
    print(s)
else:
    print(s[::-1])

Submission status: Accepted

Solution code:
import sys
def input(): return sys.stdin.readline().rstrip()
def main():
    s=input()
    if len(s)==2:print(s)
    else:print(s[::-1])

if __name__=='__main__':
    main()