Harryxun/stf_run huggingface dataset:
N,M=map(int,input().split())
MOD=10**9+7
 
def cmb(n, r, p):
  numerator = 1
  for i in range(n-r+1, n+1):
    numerator = numerator * i % p
  denominator = 1
  for j in range(1, r+1):
    denominator = denominator * j % p
  denominator = pow(denominator, p-2, p)
  return (numerator * denominator)%p
 
def factorization(n):
  l = []
  t = n
  for i in range(2, int(-(-n**0.5//1))+1):
    if t%i==0:
      cnt=0
      while t%i==0:
        cnt+=1
        t //= i
      l.append([i, cnt])
  if t!=1:
    l.append([temp, 1])
  if l==[]:
    l.append([n, 1])
  return l
 
ans=1
F=factorization(M)
for i in range(len(F)):
  f=F[i][1]
  ans*=cmb(f+N-1,f,MOD)
  ans%=MOD

if M==1:
  print(1)
else:
  print(ans)

### FIXED CODE ###

N,M=map(int,input().split())
MOD=10**9+7
 
def cmb(n, r, p):
  numerator = 1
  for i in range(n-r+1, n+1):
    numerator = numerator * i % p
  denominator = 1
  for j in range(1, r+1):
    denominator = denominator * j % p
  denominator = pow(denominator, p-2, p)
  return (numerator * denominator)%p
 
def factorization(n):
  l = []
  t = n
  for i in range(2, int(-(-n**0.5//1))+1):
    if t%i==0:
      cnt=0
      while t%i==0:
        cnt+=1
        t //= i
      l.append([i, cnt])
  if t!=1:
    l.append([t, 1])
  if l==[]:
    l.append([n, 1])
  return l
 
ans=1
F=factorization(M)
for i in range(len(F)):
  f=F[i][1]
  ans*=cmb(f+N-1,f,MOD)
  ans%=MOD

if M==1:
  print(1)
else:
  print(ans)
import math

r =[int(i) for i in input().split()]


s = r * r *pi
l = 2 * r *pi

print("{0:.5f},{1:.5f}".format(s,l))

### FIXED CODE ###

import math
r = float(input())
 
s = r * r *math.pi
l = r *2 *math.pi
 
print("{0:.5f} {1:.5f}".format(s,l))
import copy
import collections

N = int(input())
A = list(map(int,input().split()))

nCr = {}
def cmb(n,r):
    if (n,r) in nCr:
        return nCr[(n,r)]
    if r > n:
        return 0
    if r == 0 or r == n:
        return 1
    if r == 1:
        return n
    nCr[(n,r)] = cmb(n-1,r) + cmb(n-1,r-1)
    return nCr[(n,r)]

col = collections.Counter(A)
for a in A:
    s = 0
    if a in col.keys():
        col[a] = col[a] - 1
        for i in col:
            s += cmb(col[i],2)
        col[a] = col[a] + 1         
    print(s)


### FIXED CODE ###

from collections import Counter

N = int(input())
A = list(map(int,input().split()))

cnt = Counter(A)
s = 0
for v in cnt.values():
    s += v*(v-1)//2

for a in A:
    print(s - (cnt[a]-1))
import numpy as np

H, W = map(int, input().split())
S = np.array([list(input()) for _ in range(H)])=='.'

R = np.zeros((H, W), dtype=int)
L = np.zeros((H, W), dtype=int)
U = np.zeros((H, W), dtype=int)
D = np.zeros((H, W), dtype=int)

for i in range(H):
    U[i] = (U[i-1] + 1) * S[i]
    D[-i-1] = (D[-i] + 1) * S[-i-1]

for i in range(W):
    L[:, i] = (L[:, i-1] + 1) * S[:, i]
    R[:, -i-1] = (R[:, -i] + 1) * S[-i-1]

print(np.max(R+L+U+D) - 3)

### FIXED CODE ###

import numpy as np

H, W = map(int, input().split())
S = np.array([list(input()) for _ in range(H)])=='.'

R = np.zeros((H, W), dtype=int)
L = np.zeros((H, W), dtype=int)
U = np.zeros((H, W), dtype=int)
D = np.zeros((H, W), dtype=int)

for i in range(H):
    U[i] = (U[i-1] + 1) * S[i]
    D[-i-1] = (D[-i] + 1) * S[-i-1]

for i in range(W):
    L[:, i] = (L[:, i-1] + 1) * S[:, i]
    R[:, -i-1] = (R[:, -i] + 1) * S[:, -i-1]

print(np.max(R+L+U+D) - 3)
o = input()
s = list(o)
old = ''
sample = [chr(i) for i in range(97, 97+26)]
if len(s) == 26:
    if s == sample[::-1]:
        out = -1
    else:
        for i, s1 in enumerate(s[::-1]):
            if i != 0 and s1 < old[-1]:
                out = ''.join(s[:len(s)-i-1]) + min(old)
                break
            old += s1
else:
    for i1,i2 in zip(sorted(s), sample):
        if i1 != i2:
            out = o + i2
            break
print(out)

### FIXED CODE ###

s = input()
t = set(map(chr, range(ord('a'), ord('z')+1))) - set(s)
if t:
    print(s + min(t))
else:
    u = {s[-1]}
    for i in range(len(s)-1)[::-1]:
        x = [c for c in u if s[i]<c]
        if x:
            print(s[:i] + min(x))
            break
        u.add(s[i])
    else:
        print(-1)
N,M=map(int,input().split())
A=list(map(int,input().split()))
A.sort(reverse=True)
t=0
while True:
  maxi=A[0]
  maxi_2=A[1]
  t+=1
  maxi=maxi//2
  if t==M :
    A[0]=maxi
    break
  elif maxi_2>maxi :
    A[0]=maxi_2
    A[1]=maxi
    continue
  else:
    continue

amount=sum(A)
print(amount)

### FIXED CODE ###

N,M=map(int,input().split())
A=list(map(int,input().split()))
for i in range(N):
  A[i]*=-1
import heapq
heapq.heapify(A)
import math
for i in range(M):
  maxi=heapq.heappop(A)
  maxi=math.ceil(maxi/2)
  heapq.heappush(A,maxi)
  
ans=sum(A)*(-1)
print(ans)
import bisect, copy, heapq, math, sys
from collections import *
from functools import lru_cache
from itertools import accumulate, combinations, permutations, product
def input():
    return sys.stdin.readline()[:-1]
def ruiseki(lst):
    return [0]+list(accumulate(lst))
def celi(a,b):
    return -(-a//b)
sys.setrecursionlimit(5000000)
mod=pow(10,9)+7
al=[chr(ord('a') + i) for i in range(26)]
direction=[[1,0],[0,1],[-1,0],[0,-1]]

n,q=map(int,input().split())
s=input()
td=[input().split() for i in range(q)]
# print(td)

ll,lr=0,n+1
while lr-ll>1:
    mid=(lr+ll)//2
    for i in range(q):
        if mid==0:
            break
        t,d=td[i]
        if s[mid-1]==t:
            if d=="L":
                mid-=1
            else:
                mid+=1
    if mid==0:
        ll=(lr+ll)//2
    else:
        lr=(lr+ll)//2
# print(ll)

ikeru,ikenai=n+1,0
while ikeru-ikenai>1:
    mid=celi(ikeru+ikenai,2)
    for i in range(q):
        if mid==n+1:
            break
        t,d=td[i]
        if s[mid-1]==t:
            if d=="L":
                mid-=1
            else:
                mid+=1
    if mid==n+1:
        ikeru=celi(ikeru+ikenai,2)
    else:
        ikenai=celi(ikeru+ikenai,2)

# print(ikeru)
print(max(0,n-(ll+n+1-ikeru)))

### FIXED CODE ###

import bisect, copy, heapq, math, sys
from collections import *
from functools import lru_cache
from itertools import accumulate, combinations, permutations, product
def input():
    return sys.stdin.readline()[:-1]
def ruiseki(lst):
    return [0]+list(accumulate(lst))
def celi(a,b):
    return -(-a//b)
sys.setrecursionlimit(5000000)
mod=pow(10,9)+7
al=[chr(ord('a') + i) for i in range(26)]
direction=[[1,0],[0,1],[-1,0],[0,-1]]

n,q=map(int,input().split())
s=input()
td=[input().split() for i in range(q)]
# print(td)

ll,lr=0,n+1
while lr-ll>1:
    mid=(lr+ll)//2
    for i in range(q):
        if mid==0 or mid==n+1:
            break
        t,d=td[i]
        if s[mid-1]==t:
            if d=="L":
                mid-=1
            else:
                mid+=1
    if mid==0:
        ll=(lr+ll)//2
    else:
        lr=(lr+ll)//2
# print(ll)

ikeru,ikenai=n+1,0
while ikeru-ikenai>1:
    mid=celi(ikeru+ikenai,2)
    for i in range(q):
        if mid==0 or mid==n+1:
            break
        t,d=td[i]
        if s[mid-1]==t:
            if d=="L":
                mid-=1
            else:
                mid+=1
    if mid==n+1:
        ikeru=celi(ikeru+ikenai,2)
    else:
        ikenai=celi(ikeru+ikenai,2)

# print(ikeru)
print(max(0,n-(ll+n+1-ikeru)))
if a > 0:
    print('Positive')
if a <= 0 and b >= 0:
    print('Zero')
else:
    if (b - a + 1) % 2 == 0:
        print('Positive')
    else:
        print('Negative')

### FIXED CODE ###

a, b = (int(x) for x in input().split())
if a > 0:
    print('Positive')
elif a <= 0 and b >= 0:
    print('Zero')
else:
    if (b - a + 1) % 2 == 0:
        print('Positive')
    else:
        print('Negative')
N = int(input())
total = 0.0
rate = 380000.0
for i in range(N):
    money, tani = input().split()
    money = float(input())
    if tani = "JPY":
        total += money
    else:
        total += money*rate
print("%.11f"%(total))

### FIXED CODE ###

year, month, day = map(int, input().split("/"))
if year <= 2019 and month <= 4 and day <= 30:
    print("Heisei")
else:
    print("TBD")
n = int(input())
l = [0] * 100000
for i in range(n):
    a = int(input())
    if l[a] == 0:
        l[a] = 1
    else:
        l[a] = 0
print(sum(l))

### FIXED CODE ###

n = int(input())
l = [0] * 100010

mp = {}
for i in range(n):
    a = int(input())
    if a in mp:
        del mp[a]
    else:
        mp[a] = 1
print(len(mp))
k=list(map(int,input().split()))
print( abs(max(k)-max(k)[1]) + abs(max(k)[1]-max(k)[2]))

### FIXED CODE ###

k=list(map(int,input().split()))
k.sort() #デフォルトは昇順
print( abs(k[0]-k[1]) + abs(k[1]-k[2]))
x, y = map(int, input().split())

print(max(x, y) + max(max(x, y)-1, min(x,y))


### FIXED CODE ###

x, y = map(int, input().split())

print(max(x, y) + max(max(x, y)-1, min(x,y)))
S=int(input())
import math

def nCr(n,r):
    f = math.factorial
    return f(n) / f(r) / f(n-r)

possibles=1
biggest_sub=S//3
for i in range(2,biggest_sub+1):
	left=S-3*i
	possibles+=nCr(left+i-1,i-1)
print(possibles)

### FIXED CODE ###

#import sys
#input = sys.stdin.readline
Q = 10**9+7
def cmb(n,r):
    if n-r < r: r = n-r
    if r == 0: return 1
    denominator = 1                       #分母
    numerator = 1                         #分子
    for i in range(r):
        numerator *= n-i
        numerator %= Q
        denominator *= i+1
        denominator %= Q
    return numerator*pow(denominator, Q-2, Q)%Q
 
def main():
    S = int( input())
    ans = 0
    for i in range(1, S//3+1):
        t = S - i*3
        ans += cmb(t+i-1,i-1)
        ans %= Q
    print(ans)
        
if __name__ == '__main__':
    main()
n = int(input())
s = input()
ans = ""
for i in s:
  j = ((ord(i)-ord("A")) + n )//26 
'''
ord(D)-ord(A) = 68-65 = 3
n文字進める 3+n
26で割ることでたとえ3+nがAsciiコードの範囲を超えても大丈夫
'''
  ans += j
print(chr(ans))

### FIXED CODE ###

n = int(input())
s = input()
ans = ''
for i in s:
  j = ((ord(i)-ord("A")) + n )%26 
  ans += chr(j + ord("A"))
print(ans)
while(True):
    try:
        a, b, c, d, e, f = map(float, input().split(" "))
        det = e*a - b*d
        if det !=0:
            x = (e*c - b*f)/det
            y = (f*a - c*d)/det
        print("{:.3f} {:.3f)".format(x,y))
    except EOFError:
        break

### FIXED CODE ###

while(True):
        try:
            a,b,c,d,e,f=map(float,input().split(" "))
            z=a*e-b*d
            if(z!=0):
                x=(c*e-b*f)/z
                y=(a*f-c*d)/z
            print("{:.3f} {:.3f}".format(x+0,y+0))
        except:
            break
def printing(a_start, a_2, n):
    if a_start[1] == 4:
        aaaaaa

    a_3 = []
    mod_list = []
    for i in range(len(a_2)):
        if a_2[i][1] % a_start[1] not in mod_list and a_2[i][1] % a_start[1] != 0:
            a_3.append(a_2[i])
            mod_list.append(a_2[i][1] % a_start[1])
    a_3.sort(key=lambda x: x[1], reverse=True)

    ans = ""
    while n % a_start[1] != 0:
        for i in range(len(a_3)):
            if n % a_start[1] >= a_3[i][1] % a_start[1]:
                n -= a_3[i][1]
                ans += str(a_3[i][0])
                break
    ans = ans + str(a_start[0]) * (n // a_start[1])
    ans_list = sorted([ans[i] for i in range(len(ans))], reverse=True)
    print("".join(ans_list))

def main():
    n, m = [int(i) for i in input().split()]
    a = sorted([int(i) for i in input().split()], reverse=True)
    number = [0, 2, 5, 5, 4, 5, 6, 3, 7, 6]
    a_list = []
    a_2 = []

    for i in range(m):
        if number[a[i]] not in a_list:
            a_2.append([a[i], number[a[i]]])
            a_list.append(number[a[i]])
    a_2.sort(key=lambda x: x[1])
    a_start = a_2.pop(0)
    printing(a_start, a_2, n)

main()



### FIXED CODE ###

def printing(a_start, a_2, n):

    a_3 = []
    mod_list = []
    for i in range(len(a_2)):
        if a_2[i][1] % a_start[1] not in mod_list and a_2[i][1] % a_start[1] != 0:
            a_3.append(a_2[i])
            mod_list.append(a_2[i][1] % a_start[1])
    a_3.sort(key=lambda x: x[1], reverse=True)


    if len(a_3) >= 2:
        if a_start[0] + a_3[-1][0] < n and a_3[0][0] < a_3[1][0] and a_3[1][0] > a_start[0]:
            a_3.pop(0)


    ans = ""
    while n % a_start[1] != 0:
        for i in range(len(a_3)):
            if n % a_start[1] >= a_3[i][1] % a_start[1]:
                n -= a_3[i][1]
                ans += str(a_3[i][0])
                break
            elif n % a_start[1] == 0:
                break
        else:
            n -= a_3[0][1]
            ans += str(a_3[0][0])

    ans = ans + str(a_start[0]) * (n // a_start[1])
    ans_list = sorted([ans[i] for i in range(len(ans))], reverse=True)
    print("".join(ans_list))

def main():
    n, m = [int(i) for i in input().split()]
    a = sorted([int(i) for i in input().split()], reverse=True)
    number = [0, 2, 5, 5, 4, 5, 6, 3, 7, 6]
    a_list = []
    a_2 = []

    for i in range(m):
        if number[a[i]] not in a_list:
            a_2.append([a[i], number[a[i]]])
            a_list.append(number[a[i]])
    a_2.sort(key=lambda x: x[1])
    a_start = a_2.pop(0)
    printing(a_start, a_2, n)

main()
N = int(input())
P = list(map(int,input().split()))

ans = 1
for i in range(1,N):
  pi = p[i]
  pm = min(P[:i])
  if pi <= pm:
    ans +=1

print(ans)

### FIXED CODE ###

N = int(input())
P = list(map(int,input().split()))

ans = 0
m_P = P[0]
for i in range(N):
  if P[i] <= m_P:
    ans += 1
    m_P = P[i]
print(ans)
import sys
from scipy.sparse import csr_matrix
from scipy.sparse.csgraph import shortest_path
from itertools import permutations

input = sys.stdin.readline
ans = -1

n, m, r = map(int, input().split())
r  = list(map(int, input().split()))
A, B, C = [], [], []
for i in range(m):
    a, b, c = map(int, input().split())
    A.append(a-1)
    B.append(b-1)
    C.append(c)

wf = shortest_path(csr_matrix((C, (A, B)), shape = (n, n)), directed=False)

for pi in permutations(r):
    cand = 0
    for r1, r2 in zip(pi, pi[1:]):
        cand += int(wf[r1-1][r2-1])
    if ans < 0 or ans > cand:
        ans = cand

print(ans)


### FIXED CODE ###

import sys
from scipy.sparse import csr_matrix
from scipy.sparse.csgraph import floyd_warshall
from itertools import permutations

input = sys.stdin.readline
ans = -1

n, m, r = map(int, input().split())
r  = list(map(int, input().split()))
A, B, C = [], [], []
for i in range(m):
    a, b, c = map(int, input().split())
    A.append(a-1)
    B.append(b-1)
    C.append(c)

wf = floyd_warshall(csr_matrix((C, (A, B)), shape = (n, n)), directed=False)

for pi in permutations(r):
    cand = 0
    for r1, r2 in zip(pi, pi[1:]):
        cand += int(wf[r1-1][r2-1])
    if ans < 0 or ans > cand:
        ans = cand

print(ans)
import sys
readline = sys.stdin.readline

N, K = map(int, readline.split())
A = list(map(int, readline().split()))

l = 0, r = 10**10

def test(m):
	return sum((a + m - 1) // m for a in A) <= K

while l + 1 < r:
	m = (l + r) // 2
   	if test(m):
      	r = m
    else:
      	l = m

print(r)

### FIXED CODE ###

import sys
readline = sys.stdin.readline
 
N, K = map(int, readline().split())
A = list(map(int, readline().split()))
 
l = 0
r = 10**10
 
def test(m):
  return sum((a + m - 1) // m for a in A) - N <= K

while l + 1 < r:
  m = (l + r) // 2
  if test(m):
  	r = m
  else:
    l = m
print(r)
import math
def comb(n, r):
    return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))

n, k = list(map(int, input().split()))

for i in range(1,k+1):
    ans = comb(n - k + 1, i) * math.factorial(k - 1) // math.factorial(k-i) // math.factorial(i-1)
    print(ans % 1000000007)

### FIXED CODE ###

import math
def comb(n, r):
    return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))

n, k = list(map(int, input().split()))

for i in range(1,k+1):
    if n - k + 1 >= i:
        ans = comb(n - k + 1, i) * math.factorial(k - 1) // math.factorial(k-i) // math.factorial(i-1)
        print(ans % 1000000007)
    else:
        print(0)
import copy
S_dash = input()
T = input()

len_S = len(S_dash)
len_T = len(T)

candidate0 = list(S_dash)


ans = "z"*51

if len_S >= len_T:
  for s in range(len_S):
    cha_S = S_dash[s]
    if cha_S != "?" and cha_S in list(T):
      for t in range(len_T):
        cha_T = T[t]
        if cha_S == cha_T:
          S_cut = S_dash[s-t:s-t+len_T]
          
          candidate1 = copy.deepcopy(candidate0)
          
          for x in range(len_T):
            if S_cut[x] == "?":
              candidate1[s-t+x] = T[x]
            elif  S_cut[x] != T[x]:
              break
          
          else:
            if candidate1[s-t:s-t+len_T].count("?") == 0:
              if ans > "".join(candidate1).replace('?', 'a'):
                ans = "".join(candidate1).replace('?', 'a')
                
if ans == "z"*51:
  ans = "UNRESTORABLE"
print(ans)

### FIXED CODE ###

import copy
S_dash = input()
T = input()

len_S = len(S_dash)
len_T = len(T)

candidate0 = list(S_dash)


ans = "z"*51

if len_S >= len_T:
  for s in range(len_S):
    cha_S = S_dash[s]
    if cha_S != "?" and cha_S in list(T):
      for t in range(len_T):
        cha_T = T[t]
        if cha_S == cha_T and 0<= s-t < len_S and  0< s-t+len_T <= len_S:
          S_cut = S_dash[s-t:s-t+len_T]
          candidate1 = copy.deepcopy(candidate0)
          for x in range(len_T):
            if S_cut[x] == "?":
              candidate1[s-t+x] = T[x]
            elif  S_cut[x] != T[x]:
              break
          else:
            if "".join(candidate1[s-t:s-t+len_T]) == T:
              if ans > "".join(candidate1).replace('?', 'a'):
                ans = "".join(candidate1).replace('?', 'a')
  
  
  
  for u in range(len_S-len_T+1):
    cut_S = S_dash[u:u+len_T]
    if cut_S.count("?") == len_T:
      candidate1 = copy.deepcopy(candidate0)
      for t in range(len_T):
        candidate1[u+t] = T[t]
      if ans > "".join(candidate1).replace('?', 'a'):
        ans = "".join(candidate1).replace('?', 'a')
                
if ans == "z"*51:
  ans = "UNRESTORABLE"
print(ans)
import math
from functools import reduce

N,X = (int(i) for i in input().split())
x=list(map(int,input().split()))

gcd_l = []
gcd_l.append(abs(X-x[0]))

for i in range(1,N):
    gcd_l.append(abs(x[i-1]-x[i]))

print(reduce(math.gcd,gcd_l))

### FIXED CODE ###

def gcd(a, b):
	while b:
		a, b = b, a % b
	return a

def main():
    N,X = (int(i) for i in input().split())
    x=list(map(int,input().split()))

    gcd_l = []
    #gcd_l.append(abs(X-x[0]))

    for i in range(0,N):
        gcd_l.append(abs(X-x[i]))
    if N==1:
        ans = gcd_l[0]
    else:
        a = [gcd_l[0],gcd_l[1]]
        ans = gcd(max(a),min(a))
        for n in range(2,len(gcd_l)):
            a = [ans,gcd_l[n]]
            ans = gcd(max(a),min(a))
    print(ans)

main()
n = int(input())
a = list(map(int, input().split()))

m = 1
for i in range(n):
    m = m * a[i]

i = 0
while m % 2 == 0:
    m = int(m / 2)
    i = i + 1

print(i)

### FIXED CODE ###

n = int(input())
a = list(map(int, input().split()))

m = [0]*n
for i in range(n):
    while a[i] % 2 == 0:
        a[i] = a[i] / 2
        m[i] = m[i] + 1

ans = 0
for i in range(n):
    ans = ans + m[i]

print(ans)
n,k,s = map(int,input().split())
if k == 0:
	if s != 10**9:
		print(" ".join([s+1 for _ in range(n)]))
	else:
		print(" ".join(1 for _ in range(n)))
elif s != 10**9:
	ans = [10**9 for _ in range(n)]
	for i in range(k):
		ans[i] = s
	print(" ".join([str(ans[i]) for i in range(n)]))
else:
	ans = [1 for _ in range(n)]
	for i in range(k):
		ans[i] = s
	print(" ".join([str(ans[i]) for i in range(n)]))

### FIXED CODE ###

n,k,s = map(int,input().split())
if k == 0:
	if s != 10**9:
		print(" ".join([str(10**9) for _ in range(n)]))
	else:
		print(" ".join([str(1) for _ in range(n)]))
elif s != 10**9:
	ans = [10**9 for _ in range(n)]
	for i in range(k):
		ans[i] = s
	print(" ".join([str(ans[i]) for i in range(n)]))
else:
	ans = [1 for _ in range(n)]
	for i in range(k):
		ans[i] = s
	print(" ".join([str(ans[i]) for i in range(n)]))
n = int(input())

def solve(n):
	for x in range(1, 3501):
		nx = n * x
		for y in range(x, 3501):
			# 4/n = 1/x + 1/y + 1/z
			# 1/z = 4/n - 1/x - 1/y
			# z = 1/(4/n - 1/x - 1/y)
			# z = nxy/(4xy - ny - nx)
			nxy = nx * y
			den = 4*x*y - n*y -nx
			if (nxy % den == 0 and nxy//den > 0):
				print(x, y, nxy//den)
				return

solve(n)		


### FIXED CODE ###

n = int(input())

def solve(n):
	for x in range(1, 3501):
		nx = n * x
		for y in range(x, 3501):
			# 4/n = 1/x + 1/y + 1/z
			# 1/z = 4/n - 1/x - 1/y
			# z = 1/(4/n - 1/x - 1/y)
			# z = nxy/(4xy - ny - nx)
			nxy = nx * y
			den = 4*x*y - n*y -nx
			if (den > 0 and nxy % den == 0 and nxy//den > 0):
				print(x, y, nxy//den)
				return

solve(n)
a = input()
if len(a) == 2:
  print(a)
else:
  print(reverse(a))

### FIXED CODE ###

a = input()
if len(a) == 2:
  print(a)
else:
  print(a[::-1])
#python3
from itertools import count
n,x=map(int, input().split())
l=[int(i) for i in input().split()]
ans=0
d=0
for i in range(110):
  if d>x: 
    break
  d=d+l[i]
  ans=i
print(i)

### FIXED CODE ###

#python3
n,x=map(int, input().split())
l=[int(i) for i in input().split()]
d=0
c=1
for i in range(n):
  d=d+l[i]
  if d<=x:
    c+=1
print(c)
A, B = int(input())
flag = False
for C in range(1,4):
  if (A*B*C)%2 == 1:
    flag = True
    break
print("Yes") if flag else print("No")

### FIXED CODE ###

A, B = map(int, input().split())
flag = False
for C in range(1,4):
  if (A*B*C)%2 == 1:
    flag = True
    break
print("Yes") if flag else print("No")
S = input()
 
# 高々2^3=8通りなので、全て列挙すればよい
# RRR RRS SRR RSR RSS SRS SSR SSS
ans = 0
if S == 'RRR': ans = 3
elif S == 'SRR' and S == 'RRS': ans = 2
elif S == 'SSS': ans = 0
else: ans = 1
  
print(ans)

RSR SSR SRS RSS 

### FIXED CODE ###

S = input()
 
ans = 0
if S == 'RRR': ans = 3
else:
  if ('RR' in S): ans = 2
  else:
    if('R' in S): ans = 1
    else: ans = 0
 
print(ans)