Harryxun/stf_run huggingface dataset:
import sys
import os
import math

ii = lambda: int(sys.stdin.buffer.readline().rstrip())
il = lambda: list(map(int, sys.stdin.buffer.readline().split()))
iln = lambda n: [int(sys.stdin.buffer.readline().rstrip()) for _ in range(n)]

iss = lambda: sys.stdin.buffer.readline().decode().rstrip()
isn = lambda n: [sys.stdin.buffer.readline().decode().rstrip() for _ in range(n)]


def main():
    if os.getenv("LOCAL"):
        sys.stdin = open("input.txt", "r")

    N, M = il()
    SC = [il() for _ in range(M)]
    mi = pow(10, N-1)
    mx = pow(10, N)

    ret = float('inf')
    isRet = False
    for n in range(1, mx):
        isSC = True
        for sc in SC:
            s, c = sc
            if str(n)[s-1] != str(c):
                isSC = False

        if isSC:
            ret = min(ret, n)
            isRet = True

    print(ret if isRet else -1)


if __name__ == '__main__':
    main()


### FIXED CODE ###

import sys
import os


def main():
    if os.getenv("LOCAL"):
        sys.stdin = open("input.txt", "r")

    N, M = list(map(int, sys.stdin.readline().split()))
    lines = [line.rstrip() for line in sys.stdin.readlines()]

    ret = -1
    MIN = 0 if N == 1 else pow(10, N - 1)
    MAX = 10 if N == 1 else pow(10, N)
    for n in range(MIN, MAX):
        flg = True
        for line in lines:
            s, c = map(int, line.split())
            t = str(n)

            if t[s - 1] != str(c):
                flg = False

        if flg:
            ret = n
            break

    print(ret)


if __name__ == '__main__':
    main()
n=list(input())

if n[0]=="2" or n[0]=="4" or n[0]=="5" or n[0]=="7" or n[0]=="9":
    print("hon")
elif n[0]=="0" or n[0]=="1" or n[0]=="6" or n[0]=="8":
    print("pon")
else:
    n[0]=="3":
    print("bon")

### FIXED CODE ###

n=list(input())

n==n.reverse()

if (n[0]=="2" or n[0]=="4" or n[0]=="5" or n[0]=="7" or n[0]=="9"):
    print("hon")
elif (n[0]=="0" or n[0]=="1" or n[0]=="6" or n[0]=="8"):
    print("pon")
elif (n[0]=="3"):
    print("bon")
N, M = [int(i) for i in input().split()]
a = [int(i) for i in input().split()]
a.sort()                        # 破壊的。返り値はNone

# print(N, M)
# print(a)

num = [0, 2, 5, 5, 4, 5, 6, 3, 7, 6]


dp = []
for i in range(N+1):
    n = [dp[i-num[a[j]]] for j in range(M) if i-num[a[j]] >= 0]
    if len(n) == 0:
        dp.append(0)
    else:
        dp.append(max(n) + 1)

# print(dp)

i = N
ans = ""
for _ in range(dp[N]):
    # print("i", i)
    # c = [(a[j], dp[i-num[a[j]]], dp[i]) for j in range(M)]
    # print("c", c)
    if dp[i] > 1:
        b = max([a[j] for j in range(M)
                 if i - num[a[j]] >= 0 and dp[i-num[a[j]]] + 1 == dp[i]])
        ans += str(b)
    else:
        b = max([a[j] for j in range(M)
                 if i - num[a[j]] == 0 and dp[i-num[a[j]]] + 1 == dp[i]])
        ans += str(b)
        break
    # print("ans", ans)
    i = i-num[b]
    # print(i)
print(ans)


### FIXED CODE ###

N, M = [int(i) for i in input().split()]
a = [int(i) for i in input().split()]
a.sort()                        # 破壊的。返り値はNone

# print(N, M)
# print(a)

num = [0, 2, 5, 5, 4, 5, 6, 3, 7, 6]


dp = [-999 for _ in range(N+1)]
dp[0] = 0
for i in range(N+1):
    n = [dp[i-num[a[j]]] for j in range(M) if i-num[a[j]] >= 0]
    if len(n) > 0:
        dp[i] = max(n) + 1

# print(dp)

i = N
ans = ""
for _ in range(dp[N]):
    # print("i", i)
    # c = [(a[j], dp[i-num[a[j]]], dp[i]) for j in range(M)]
    # print("c", c)
    if dp[i] > 1:
        b = max([a[j] for j in range(M)
                 if i - num[a[j]] >= 0 and dp[i-num[a[j]]] + 1 == dp[i]])
        ans += str(b)
    else:
        b = max([a[j] for j in range(M)
                 if i - num[a[j]] == 0 and dp[i-num[a[j]]] + 1 == dp[i]])
        ans += str(b)
        break
    # print("ans", ans)
    i = i-num[b]
    # print(i)
print(ans)
import sympy
sympy.divisors(10**9)


def make_divisors(n):
    lower_divisors , upper_divisors = [], []
    i = 1
    while i*i <= n:
        if n % i == 0:
            lower_divisors.append(i)
            if i != n // i:
                upper_divisors.append(n//i)
        i += 1
    return lower_divisors + upper_divisors[::-1]

n =int(input())
ans = 0
for i in range(1,n+1,1):
    ans += i*len(make_divisors(i))


print(ans)

### FIXED CODE ###


n =int(input())

sum = 0
for i in range (1,n+1,1):
    k= n//i
    sum += int(i*k*(k+1)/2)

print(sum)
def output(list):
    for i,row in enumerate(list):
        if i == 0:
            print(row,end='')
        else:
            print('',row,end='')
    

s = input()
list = list(map(int,input().split()))

output(list)
print()

#print(list)
start = time.time()
i = 0
for count in range(len(list)-1):

#   Judge: now > next
    if list[i] > list[i+1]:

#       Change: now > next
        ins_num = list[i+1]
        list[i+1] = list[i]
        list[i]   = ins_num

        j = i - 1

        while j >= 0:
            if list[j] > ins_num:
                list[j+1] = list[j]
                list[j]   = ins_num

            j -= 1
        output(list)
    else:
        output(list)        
    
    print()
    i += 1

### FIXED CODE ###

def output(list):
    for i,row in enumerate(list):
        if i == 0:
            print(row,end='')
        else:
            print('',row,end='')
    
def main():
    s = input()
    s_list = []
    s_list = list(map(int,input().split()))

    output(s_list)
    print()

    i = 0
    for count in range(len(s_list)-1):

#   Judge: now > next
        if s_list[i] > s_list[i+1]:

#       Change: now > next
            ins_num = s_list[i+1]
            s_list[i+1] = s_list[i]
            s_list[i]   = ins_num

            j = i - 1

            while j >= 0:
                if s_list[j] > ins_num:
                    s_list[j+1] = s_list[j]
                    s_list[j]   = ins_num

                j -= 1
            output(s_list)
        else:
           output(s_list)        
    
        print()
        i += 1

if __name__ == '__main__':
    main()
N = int(input())
sum=0
for i in range( 1, N+1):
  if !(i%5==0) and !(i%3==0):
    sum+=i
print(sum)

### FIXED CODE ###

N = int(input())
sum=0
for i in range(1,N+1):
  if ((i%3!=0)and(i%5!=0)):
    sum+=i
print(sum)
a,b,c,d = map(int, input().split())

if b<=c:
    print(0)
elif a<=c and b<=d:
    print(b-c)
elif a<=c and d<=b:
    print(d-c)
elif c<=a and b<=d:
    print(b-a)
elif c<=a and d<=b:
    print(d-a)
elif d<=a
    print(0)

### FIXED CODE ###

a,b,c,d = map(int, input().split())

if b<=c or d<=a:
    print(0)
elif a<=c and b<=d:
    print(b-c)
elif a<=c and d<=b:
    print(d-c)
elif c<=a and b<=d:
    print(b-a)
elif c<=a and d<=b:
    print(d-a)
else:
    print(0)
r = input()
print(3 * r^3)

### FIXED CODE ###

r = int(input())
print(3 * r**2)
#import math
#from functools import reduce
from fractions import gcd
#from functools import lru_cache

#def lcm_base(x, y):
#    return (x * y) // gcd(x, y)

#def lcm(numbers):
#    return reduce(lcm_base, numbers, 1)

#@lru_cache(maxsize=1000)
def lcm(a):
    x = a[0]
    for i in range(1, len(a)):
        x = (x * a[i]) // gcd(x, a[i])
    return x


n = int(input())
A = [int(x) for x in input().split()]

t_lcm = lcm(A)
count = 0
for i in A:
    count += t_lcm/i
    
print(int(count%(10**9+7)))


### FIXED CODE ###

#import math
#from functools import reduce
from fractions import gcd
#from functools import lru_cache


#def lcm_base(x, y):
#    return (x * y) // gcd(x, y)

#def lcm(numbers):
#    return reduce(lcm_base, numbers, 1)


def lcm(a):
    x = a[0]
    for i in range(1, len(a)):
        x = (x * a[i]) // gcd(x, a[i])
    return x


n = int(input())
A = [int(x) for x in input().split()]

t_lcm = lcm(A)
count = 0
for i in A:
    count += t_lcm//i
    
print(count%(10**9+7))
import math
import sys

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

n, m = map(int,input().split())

if n <= 1
  print(comb(m, 2))
  sys.exit()
  
if m <=1
  print(comb(n, 2))
  sys.exit()

if n == 1 and m == 1:
  print('0')
  sys.exit()

print(comb(n, 2) + comb(m, 2))


### FIXED CODE ###

import math
import sys

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

n, m = map(int,input().split())

if n == 1 and m == 1:
  print('0')
  sys.exit()
  
if n <= 1:
  print(comb(m, 2))
  sys.exit()
  
if m <=1:
  print(comb(n, 2))
  sys.exit()

print(comb(n, 2) + comb(m, 2))
#coding: UTF-8

def Rectangle_Area(a,b):
    return a*b

def Rectangle_Length(a,b):
    return 2*a+2*b

if __name__=="__main__":
    a = input()
    b = input()
    area = Rectangle_Area(int(a),int(b))
    length = Rectangle_Length(int(a),int(b))
    print(area,length)

### FIXED CODE ###

#coding: UTF-8

def Rectangle(a,b):
    return a*b,2*(a+b)

if __name__=="__main__":
    a = input().split(" ")
    area,length = Rectangle(int(a[0]),int(a[1]))
    print(area,length)
import fractions
import functools
n=int(input())
a=list(map(int,input().split()))
b=[0]*(n-1)
for i in range(n-1):
  b[i]=fractions.gcd(a[i],a[i+1])
m=min(b)
c=b.count(m)
if c==1:
  idx=b.index(m)
  del b[idx]
  print(min(b))
else:
  print(min(b))
  


### FIXED CODE ###

import fractions 
n=int(input())
a=list(map(int,input().split()))
ans=a[0]
sna=a[n-1]
Ans=[ans]*n
Sna=[sna]*n
for j in range(1,n):
  ans=fractions.gcd(ans,a[j])
  Ans[j]=ans
  sna=fractions.gcd(sna,a[n-j-1])
  Sna[j]=sna
m=Sna[n-2]
for k in range(n-2):
  m=max(m,fractions.gcd(Ans[k],Sna[n-3-k]))
m=max(m,Ans[n-2])
print(m)
n = int(input())
a = 0
for i in range(1,10):
    if n % i != 0:
        continue
    else:
        if n / i <= 9:
            a += 1
            break
        else:
            continue
if a == 1:
	print('Yes')
else:
	print('No')

### FIXED CODE ###

a,b = map(int,input().split())

if a > 9 or b > 9:
    print('-1')
else:
	print(a*b)
n = int(input())
a = []
for i in range(n):
    a.append(list(map(int, input().split())))
a0 = a[0]
N = int(a0[0])
K = int(a0[1])
b =list(range(0,N-1))
for i in range(K):
    di = int(a[2i+1])
    bi = a[2i+2]
for l in range(N):
    for i in range(K):
        for k in range(di):
            if bi[k] == l:
            	b.remove(l)
                bi.remove(l)
print(len(b))

### FIXED CODE ###

N, K = map(int, input().split())
d = []
A = []
s = [1] * N
for k in range(K):
  d.append(int(input()))
  A.append([int(i) for i in input().split()])
  
for k in range(K):
  for n in range(1, N+1):
    if n in A[k]:
      if s[n-1] == 1:
        s[n-1] = 0
print(sum(s))
# input
N = int(input())
S = [input() for _ in range(N)]

# process
l1 = []
l2 = []
for s in S:
    i=0
    a = 0
    b = 0
    while i < len(s) and s[i] == ')':
        a += 1
        i += 1
    while i < len(s):
        if s[i] == '(':
            b += 1
        else:
            b -= 1
        i += 1
    
    if a+b != 0:
        if a <= b:
            l1.append((a, b))
        else:
            l2.append((b, a))

l1.sort()
l2.sort(reverse=True)

result = False
x = 0
if l1[0][0] == 0 and l2[-1][0] == 0:
    for a, b in l1:
        x += b-a
    for b, a in l2:
        x += b-a

    if x == 0:
        result = True

# output
print("Yes" if result else "No")


### FIXED CODE ###

# input
N = int(input())
S = [input() for _ in range(N)]

# process
T = []
for s in S:
    while '()' in s:
        s = s.replace('()', '')
    T.append(s)

l1 = []
l2 = []
for t in T:
    op = t.find('(')
    if op < 0:
        op = len(t)
    cl = len(t) - op
    
    if cl+op != 0:
        if cl <= op:
            l1.append((cl, op))
        else:
            l2.append((op, cl))

l1.sort()
l2.sort(reverse=True)

result = False
x = 0
if len(l1)+len(l2) == 0:
    result = True
elif len(l1)>0 and len(l2)>0 and l1[0][0]+l2[-1][0] == 0:
    for cl, op in l1:
        x -= cl
        if x < 0:
            break
        x += op
    
    if x >= 0:
        for op, cl in l2:
            x -= cl
            if x < 0:
                break
            x += op
            
        if x == 0:
            result = True

# output
print("Yes" if result else "No")
import sys
sys.setrecursionlimit(20000000)

N = int(input())
A = [[0]*(N)]
for _ in range(N):
    A.append([0]+list(map(int,input().split())))

#選手iにとって、選手jが何番目の相手かを逆引きするメモを用意しておく。
reverseMemo = {i:{} for i in range(1,N+1)}
for i in range(1,N+1):
    for j in range(1,N):
        a = A[i][j]
        reverseMemo[i][a] = j

dp = [[0]+[None]*N for _ in range(N+1)]

def f(i,j,cnt):
    #iとjの試合が最速でいつできるかを返す。
    if cnt > N*N:
        print(-1)
        exit()
    if dp[i][j] == None and dp[j][i] == None:
        #iの一つ前の試合がいつおわるかを調べる。
        pre = A[i][reverseMemo[i][j]-1]
        tmp1 = f(i,pre,cnt+1)
        
        #jの一つ前の試合がいつおわるかを調べる。
        pre = A[j][reverseMemo[j][i]-1]
        tmp2 = f(j,pre,cnt+1)

        dp[i][j] = max(tmp1,tmp2)+1

    elif dp[i][j] == None and dp[j][i] != None:
        dp[i][j] = dp[j][i]
    elif dp[i][j] != None and dp[j][i] != None:
        dp[j][i] = dp[i][j]
    return dp[i][j]

ans = 0
for i in range(1,N+1):
    for j in range(1,N):
        a = A[i][j]
        ans = max(ans,f(i,a,0))
print(ans)

### FIXED CODE ###

"""
最長経路問題として解く。

各試合のノードを作成。
各試合ノードごとに、「この試合が終わったら、次はこの試合ができるようになる。」という対応関係を作っていく。
"""
def main():
    import sys
    sys.setrecursionlimit(1000000)
    input = sys.stdin.readline

    N = int(input())

    A = [[0]*(N)]
    for i in range(N):
        A.append([0]+list(map(int,input().split())))
    
    #選手iにとって、選手jが何番目の相手かを逆引きするメモを用意しておく。
    reverseMemo = [[-1]*(N+1) for _ in range(N+1)]
    for i in range(1,N+1):
        for j in range(1,N):
            a = A[i][j]
            reverseMemo[i][a] = j
    edges = {}
    for i in range(1,N+1):
        for j in range(i+1,N+1):
            match = (i,j)
            edges[match] = []
            if reverseMemo[i][j] != N-1:
                nx = A[i][reverseMemo[i][j]+1]
                edges[match].append((min(i,nx),max(i,nx)))
            if reverseMemo[j][i] != N-1:
                nx = A[j][reverseMemo[j][i]+1]
                edges[match].append((min(j,nx),max(j,nx)))
    
    del reverseMemo
    del A
    
    stepMemo = {}
    def dfs(i,j,path):
        #i,jの試合日を含めて、あと何日必要なのかを返す。
        if (i,j) not in stepMemo:
            if (i,j) in path:
                print(-1)
                exit()
            else:
                path.add((i,j))
            res = 1
            for a,b in edges[(i,j)]:
                res = max(res,dfs(a,b,path)+1)
            stepMemo[(i,j)] = res
        return stepMemo[(i,j)]

    ans = 0
    for i in range(1,N+1):
        for j in range(i+1,N+1):
            if (i,j) not in stepMemo:
                ans = max(ans,dfs(i,j,set()))
    print(ans)
main()
n, k = map(int,input().split())
a_list = list(map(int,input().split()))
a_list.sort()

from operator import mul
from functools import reduce

def cmb(n,r):
    r = min(n-r,r)
    if r == 0: return 1
    over = reduce(mul, range(n, n - r, -1))
    under = reduce(mul, range(1,r + 1))
    return over // under

sum_val = 0
val = cmb(n-1, k-1)
for i in range(n-k+1):
    if i != 0:
        val = val*(n-i-k+1)/(n-i)
    sum_val = (sum_val + (a_list[-(i+1)]*val) - (a_list[i]*val)+(10**9+7)*2)%(10**9+7)

print(int(sum_val))

### FIXED CODE ###

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


mod = 10 ** 9 + 7
f_list = [1]
for i in range(1,n+1):
    f_list.append((f_list[-1] * i) % mod)
def comb(n,r):
    return f_list[n] * (pow(f_list[r], mod-2, mod) * pow(f_list[n-r], mod-2, mod) % mod) % mod


max_val = 0
min_val = 0
for i in range(n - k + 1):
    val = comb(n - i - 1, k - 1)
    max_val = (max_val + (((a_list[-(i + 1)]) * val))) % (10 ** 9 + 7)
    min_val = (min_val + ((a_list[i]) * val)) % (10 ** 9 + 7)

print(int((max_val - min_val) % (10 ** 9 + 7)))
while True:
    S = raw_input()

    if (S == "0 ? 0"):
        break

    print eval(S)
    

### FIXED CODE ###

while True:
    S = raw_input()

    if S.split(" ")[1] == "?":
        break

    print eval(S)
#coding: utf-8
import re
A,B = map(int,input().split())
S = input()
find_underscore = re.findall("\-",S[A])
find_num_a = re.findall("[0-9]",S[:A-1])
find_num_b = re.findall("[0-9]",S[A+1:])
if find_underscore and find_num_a and find_num_b:
    print("Yes")
else:
    print("No")

### FIXED CODE ###

#coding: utf-8
M = int(input())
x = 24 + (24 - M) 
print(x)
s=input()
t=count('o')
print(700+t*100)

### FIXED CODE ###

s=input()
t=s.count('o')
print(700+t*100)
import sys
import math
w, h, x, y = map(int, sys.stdin.readline().split())

d1 = abs(x*1+y*(-1)+w*h)/math.sqrt(1**2 + (-1)**2)
d2 = abs(x*(-h/w)+y*(-1)+h)/math.sqrt((-h/w)**2 + (-1)**2)

if int(w-2*x)==0 and int(h-2*y)==0:
  print(w*h/2.0, 1)
  exit()
elif int(w-2*x)==0 or int(h-2*y)==0:
  print(w*h/2.0, 0)
  exit()

if int(d1) == 0 or int(d2) == 0:
  if int(w-2*x)==0 and int(h-2*y)==0:
    print(w*h/2.0, 1)
  else:
    print(w*h/2.0, 0)
elif d1 < d2:
  if x > 0.5*w:
    if y < h/w*x:
      print((x*w*w)/y*0.5, 0)
    else:
      print((x*h*h)/y*0.5, 0)
  else:
    b = h - (h-y)/(w-x)*w
    if y < h/w*x:
      print(h*(w-b*(w-x)/(h-y))*0.5, 0)
    else:
      print(w*(h-b)*0.5, 0)
else:
  if int(d1-d2) == 0:
    casenum = 1
  else:
    casenum = 0
    
  if x > 0.5*w:
    if  y > h/w*x:
      print(w*(-(y-h)*w/x)*0.5, casenum)
    else:
      print(h*x*h/(h-y)*0.5, casenum)
  else:
    b = (h + y*w/(x-w)) * (x-w)/y
    if  y > h/w*x:
      print(h*(w-(b-h)*x/(y-h))*0.5, casenum)
    else:
      print((w-b)*h*0.5, casenum)

### FIXED CODE ###

import sys
x, a = map(int, sys.stdin.readline().split())
if x < a:
  print(0)
else:
  print(10)
num = int(input())
given = input()
new = given.split()
x = 0
max = 0
for i in range(num):
  if new[i] == "D":
    x -= 1
  if new[i] == "I":
    x += 1
  if max < x:
    max = x
print(max)


### FIXED CODE ###

num = int(input())
new = input()

x = 0
m = 0
for i in range(num):
  if new[i] == "D":
    x -= 1
  if new[i] == "I":
    x += 1
  if m < x:
    m = x
print(m)
def main(n,m,g,uv):
    # 1<=E<=n-1
    eary=[inf]*m
    vary=[inf]*n
    vary[-1]=0
    todo=[n-1]
    def dfs(v,x):
        if vary[v]<inf:return vary[v]
        ret=0
        cnt=0
        for i,nv in g[v]:
            if i==x:continue
            tmp=dfs(nv,x)+1
            eary[i]=tmp
            ret+=tmp
            cnt+=1
        if cnt==0:
            for i in range(n):
                vary[i]=inf
            return inf
        vary[v]=ret/cnt
        return ret/cnt
    e0=dfs(0,-1)
    ary=[-1]*m
    bary=[0]*n
    bary[0]=1
    for v in range(n):
        k=len(g[v])
        e=vary[v]
        for i,nv in g[v]:
            bary[nv]+=1/k*bary[v]
            if k>1 and bary[v]:
                ary[i]=max(0,e-(e*k-eary[i])/(k-1))
                ary[i]*=bary[v]
    #print(e0)
    #print(vary)
    #print(ary)
    #print(bary)
    return e0-max(0,max(ary))

n,m=map(int,input().split())
uv=[list(map(int,input().split())) for _ in range(m)]
g=[[] for _ in range(n)]
for i,(u,v) in enumerate(uv):
    u,v=u-1,v-1
    g[u].append((i,v))
print(main(n,m,g,uv))

### FIXED CODE ###

import sys
sys.setrecursionlimit(10**7)
inf=float('inf')

def main(n,m,g,uv):
    # 1<=E<=n-1
    eary=[inf]*m
    vary=[inf]*n
    vary[-1]=0
    todo=[n-1]
    def dfs(v,x):
        if vary[v]<inf:return vary[v]
        ret=0
        cnt=0
        for i,nv in g[v]:
            if i==x:continue
            tmp=dfs(nv,x)+1
            eary[i]=tmp
            ret+=tmp
            cnt+=1
        if cnt==0:
            for i in range(n):
                vary[i]=inf
            return inf
        vary[v]=ret/cnt
        return ret/cnt
    e0=dfs(0,-1)
    ary=[-1]*m
    bary=[0]*n
    bary[0]=1
    for v in range(n):
        k=len(g[v])
        e=vary[v]
        for i,nv in g[v]:
            bary[nv]+=1/k*bary[v]
            if k>1 and bary[v]:
                ary[i]=max(0,e-(e*k-eary[i])/(k-1))
                ary[i]*=bary[v]
    return e0-max(0,max(ary))

n,m=map(int,input().split())
uv=[list(map(int,input().split())) for _ in range(m)]
g=[[] for _ in range(n)]
for i,(u,v) in enumerate(uv):
    u,v=u-1,v-1
    g[u].append((i,v))
print(main(n,m,g,uv))
import math

def P(n, r):
    return math.factorial(n)//math.factorial(n-r)


def C(n, r):
    if n == 1:
        return 0
    return P(n, r)//math.factorial(r)

n, m = map(int, input().split())

print(C(n, 2) + C(m, 2))

### FIXED CODE ###

import math

def P(n, r):
    if n < r:
        return 0
    return math.factorial(n)//math.factorial(n-r)


def C(n, r):
    return P(n, r)//math.factorial(r)

n, m = map(int, input().split())

print(C(n, 2) + C(m, 2))
A, B = map(input, int().split())
print((B-1)//(A-1))


### FIXED CODE ###

import math
A, B = map(int, input().split())
print(math.ceil((B-1)/(A-1)))
#coding:UTF-8
As=input()
Bs=input()
Cs=input()
a=int(As)
b=int(Bs)
print(a*b/2)

### FIXED CODE ###

a,b,c=map(int,input().split())
print(a*b//2)
n = int(input())
h = list(map(int, input().split()))

sa = []

for i in range(n-1):
    sa.append(h[i+1]-h[i])

#print(sa)

ans = 0
for i in range(n-1):
    if sa[i] == 0 and sa[i+1] < 0:
        print('No')
        exit(0)
    else:
        if sa[i] == -1:
            ans += 1
        elif sa[i] >= 0:
            ans += sa[i]
        else:
            ans += 999
    
    if ans > 1:
        print('No')
        exit(0)
        
#print(ans)
print('Yes')

### FIXED CODE ###

n=int(input())
h=list(map(int,input().split()))
f=True
m=0
for i in range(n):
    if h[i]>m:
        m=h[i]-1
    elif h[i]==m:
        continue
    else:
        f=False
        break
print('Yes' if f else 'No')
import math
from math import gcd,pi,sqrt
INF = float("inf")

import sys
sys.setrecursionlimit(10**6)
import itertools
from collections import Counter,deque
def i_input(): return int(input())
def i_map(): return map(int, input().split())
def i_list(): return list(i_map())
def i_row(N): return [i_input() for _ in range(N)]
def i_row_list(N): return [i_list() for _ in range(N)]
def s_input(): return input()
def s_map(): return input().split()
def s_list(): return list(s_map())
def s_row(N): return [s_input for _ in range(N)]
def s_row_str(N): return [s_list() for _ in range(N)]
def s_row_list(N): return [list(s_input()) for _ in range(N)]

def main():
    n = i_input()
    l = [i_list() for i in range(n)]

    for x in range(101):
        for y in range(101):
            H = l[0][2] + abs(x-l[0][0]) + abs(y-l[0][1])
            flg = True
            for x1, y1, h1 in l[1:]:
                if H != h1 + abs(x-x1) + abs(y-y1):
                    flg = False
                    break
            if flg == True:
                ans = [x,y]
    H = l[0][2] + abs(ans[0]-l[0][0]) + abs(ans[1]-l[0][1])
    print(" ".join(map(str, ans)) +" "+str(H))



if __name__=="__main__":
    main()


### FIXED CODE ###

import math
from math import gcd,pi,sqrt
INF = float("inf")

import sys
sys.setrecursionlimit(10**6)
import itertools
from collections import Counter,deque
def i_input(): return int(input())
def i_map(): return map(int, input().split())
def i_list(): return list(i_map())
def i_row(N): return [i_input() for _ in range(N)]
def i_row_list(N): return [i_list() for _ in range(N)]
def s_input(): return input()
def s_map(): return input().split()
def s_list(): return list(s_map())
def s_row(N): return [s_input for _ in range(N)]
def s_row_str(N): return [s_list() for _ in range(N)]
def s_row_list(N): return [list(s_input()) for _ in range(N)]

def main():
    n = i_input()
    l = [i_list() for i in range(n)]

    L = []

    for i in l:
        if i[2] != 0:
            L.append(i)
    if len(L) == 1:
        print(" ".join(map(str, L[0])))
        exit()

    for x in range(101):
        for y in range(101):
            H = L[0][2] + abs(x-L[0][0]) + abs(y-L[0][1])
            flg = True
            for x1, y1, h1 in L[1:]:
                if h1 == 0:
                    pass
                if H != h1 + abs(x-x1) + abs(y-y1):
                    flg = False
                    break
            if flg == True:
                ans = [x,y]
    H = L[0][2] + abs(ans[0]-L[0][0]) + abs(ans[1]-L[0][1])
    print(" ".join(map(str, ans)) +" "+str(H))


if __name__=="__main__":
    main()
s=input()
j=["Sunny","Cloudy","Rainy"]
j=j+j
print(j[j.index(s)+1]

### FIXED CODE ###

s=input()
j=["Sunny","Cloudy","Rainy"]
j=j+j
print(j[j.index(s)+1])