Harryxun/stf_run huggingface dataset:
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

def culcC(num):
    if num  < 2:
        return 1
    ret = 1
    minus2 = 1
    while(True):
#         ret += int(comb(num - minus2,minus2 if minus2 >0 else 1,exact=True))
        ret += cmb(num - minus2,minus2 if minus2 >0 else 1)
        minus2 += 1
        if num - 2 * minus2 < 0:
            break
    return ret
            
n,m = map(int,input().split())
aa = [int(input()) for i in range(m)]

if n == 1:
    print(1)
else:
    ans = 1
    stand = 0
    for i,a in enumerate(aa):
        
#        連続穴
        if stand == a:
            ans = 0
            break
            
        step_num = a - stand - 1
        ans *= culcC(step_num)
        stand = a + 1
#         print(step_num,ans,stand)
        
    # 最後のaからnまでで計算
    ans *= culcC(n - aa[-1] - 1)
    
    print(ans % 1000000007)

### FIXED CODE ###

def fib(num):
    a, b = 0, 1 
    for _ in range(num - 1):
#         print(a)
        a, b = a + b, a
    return a + b

def culcC(num):
    if num  < 2:
         return 1
    return fib(num) + fib(num-1)
            
n,m = map(int,input().split())
aa = [int(input()) for i in range(m)]

if n == 1:
    print(1)
elif m == 0:
    print(culcC(n) % 1000000007)
else:
    ans = 1
    stand = 0
    for i,a in enumerate(aa):
#        連続穴
        if stand == a:
            ans = 0
            break
        step_num = a - stand - 1
        c = culcC(step_num)
        ans *= c if c > 0 else 1
        stand = a + 1
        
    # 最後のaからnまでで計算
    ans *= culcC(n - aa[-1] - 1)
    
    print(ans % 1000000007)
a , b = map(int, input().split())
for i in range(1 , 10100) :
  a1 = int(i*0.08)
  b1 = int(i*0.10)
  if a1 = a and b1 = b :
    print(i)
  else :
    print(-1)

### FIXED CODE ###

a,b = map(int, input().split())
ans = -1
for i in range(1001) :
  a1 = int(i*0.08)
  b1 = int(i*0.1)
  if a1 == a and b1 == b :
    ans = i
    break
print(ans)
a,b,c=map(int,input().split())
if a[-1]==b[0] and b[-1]==c[0]:
    print("YES")
else:
    print("NO")

### FIXED CODE ###

a,b,c=input().split()
if a[-1]==b[0] and b[-1]==c[0]:
    print("YES")
else:
    print("NO")
a = int(input())
if a >= 3200:
  s = input()
  print(s)
 else:
  print('red')

### FIXED CODE ###

a = input()
a = int(a)
if a >= 3200:
  s = input()
  print(s)
else:
  print('red')
import sys,collections as cl,bisect as bs
sys.setrecursionlimit(100000)
Max = sys.maxsize
def l():
    return list(map(int,input().split()))
def m():
    return map(int,input().split())
def onem():
    return int(input())
def s(x):
    a = []
    aa = x[0]
    su = 1
    for i in range(len(x)-1):
        if aa == x[i+1]:
            a.append([aa,su])
            aa = x[i+1]
            su = 1
        else:
            su += 1
    a.append([aa,su])
    return a
def jo(x):
    return " ".join(map(str,x))

n = onem()

a = l()
a.sort()
a  = cl.deque(a)
aa = []
co = 0
while True:
    if len(a) == 3:
        if a[1] >= 0:
            z = a.pop()
            zz = a.popleft()
            bs.insort(a,zz-z)
            aa.append([zz,z])
        else:
            z = a.pop()
            zz = a.popleft()
            bs.insort(a,z-zz)
            aa.append([z,zz])
    elif len(a) == 2:
        aa.append([max(a),min(a)])
        bs.insort(a,max(a),min(a))
        break
    elif len(a) == 1:
        break
    if co % 2 == 0:
        z = a.pop()
        zz = a.popleft()
        bs.insort(a,z-zz)
        aa.append([z,zz])
        co += 1
    else:
        z = a.pop()
        zz = a.popleft()
        bs.insort(a,zz-z)
        aa.append([zz,z])
        co += 1

print(a[0])
for i in range(n-1):
    print(jo(aa[i]))



### FIXED CODE ###

import sys,collections as cl,bisect as bs
sys.setrecursionlimit(100000)
Max = sys.maxsize
def l():
    return list(map(int,input().split()))
def m():
    return map(int,input().split())
def onem():
    return int(input())
def s(x):
    a = []
    aa = x[0]
    su = 1
    for i in range(len(x)-1):
        if aa == x[i+1]:
            a.append([aa,su])
            aa = x[i+1]
            su = 1
        else:
            su += 1
    a.append([aa,su])
    return a
def jo(x):
    return " ".join(map(str,x))

n = onem()

a = l()
a.sort()
a = cl.deque(a)
aa = []
co = 0
up = a.pop()
do = a.popleft()

for i in range(len(a)):
    if a[i] >= 0:
        aa.append([do,a[i]])
        do -= a[i]
    else:
        aa.append([up,a[i]])
        up -= a[i]    
aa.append([up,do])
print(up-do)
for i in range(n-1):
    print(jo(aa[i]))
a,b,c=int(input().split()
if a==5 and b==5 and c==7 or a==5 and b==7 and c==5 or a==7 and b==5 and c==5:
    print('YES')
else:
    print('NO'

### FIXED CODE ###

same = tuple(sorted(map(int, input().split()))) == (5, 5, 7)
print("YES" if same else "NO")
N = int(input())
 SP = [list(map(str, input().split())) for _ in range(N)]

 for i in range(N):
   SP[i].append(i+1)
   SP[i][1] = int(SP[i][1])*(-1)

 ans = sorted(SP, key=lambda x:(x[0],x[1]))

 for i in range(N):
   print(ans[i][2])


### FIXED CODE ###

N = int(input())
SP = [list(map(str, input().split())) for _ in range(N)]

for i in range(N):
  SP[i].append(i+1)
  SP[i][1] = int(SP[i][1])*(-1)

ans = sorted(SP, key=lambda x:(x[0],x[1]))

for i in range(N):
  print(ans[i][2])
import collections
q = collections.deque()

n = int(input())
for i in range(n):
    com = input().split()
    if com[0] == 'insert':
        q.appendleft(int(com[1]))
    elif com[0] == 'delete':
        try:
            q.remove(int(com[1]))
        except:
            pass
    elif com[0] == 'deleteFirst':
        q.popleft()
    elif com[0] == 'deleteLast':
        q.pop()
print(' '.join(q))

### FIXED CODE ###

import collections
q = collections.deque()
n = int(input())
for i in range(n):
    com = input().split()
    if com[0] == 'insert':
        q.appendleft(int(com[1]))
    elif com[0] == 'delete':
        try:
            q.remove(int(com[1]))
        except:
            pass
    elif com[0] == 'deleteFirst':
        q.popleft()
    elif com[0] == 'deleteLast':
        q.pop()
print(*q)
T,X=(int(x) for x input().split())
print(T/X)

### FIXED CODE ###

T,X=map(int,input().split())
print(T/X)
import functools


def divise(n, divisor):
    if n == divisor:
        return n
    elif n % divisor == 0:
        return 0
    else:
        return n

number = int(input())
origin = [int(input()) for x in range(number)]

divised = origin  # initialize

for i in range(2, max(origin)+1):
    divised = list(map(functools.partial(divise, divisor=i), divised))

for j in range(number):
    if divised[j] == 0:
        origin.pop(j)

print(len(origin))

### FIXED CODE ###

def is_prime(n):
    i = 2
    while i * i <= n:
        if n % i == 0:
            return False
        i += 1
    return True

count = 0

number = int(input())
for i in range(number):
    n = int(input())
    if is_prime(n):
        count = count + 1

print(count)
tall = int(input())
bit = round(tall**(1/2))
while (bit/tall%1 != 0):
  bit -= 1
print(bit+tall/b-2)

### FIXED CODE ###

tall = int(input())
bit = int(tall**(1/2))
while ((tall/bit)%1 != 0):
  bit -= 1
print(int(bit+tall/bit-2))
import sys


def main():
    a, b = [int(s) for s in sys.stdin.readline().strip().split()]

    def gcd(x, y):
        while y:
            x, y = y, x % y
        return x

    def divisors(n, d, ans):
        if n == 1:
            return
        if n % d == 0:
            ans.append(d)
            divisors(n // d, d, ans)
        else:
            divisors(n, d+1, ans)

    gcd_val = gcd(a, b)
    divs = []
    divisors(gcd_val, 2, divs)
    print(100)
    # ans = 1
    # for div in sorted(list(divs)):
    #     if div == 1:
    #         continue
    #     if gcd_val % div == 0:
    #         ans += 1
    #         while gcd_val % div == 0 and gcd_val > 1:
    #             gcd_val = gcd_val // div
    # print(ans)


main()


### FIXED CODE ###

import sys
import math

def main():
    a, b = [int(s) for s in sys.stdin.readline().strip().split()]

    def factorize(x):
        ret = set()
        for n in range(2, int(math.sqrt(x))+2):
            if x % n == 0:
                while x % n == 0:
                    x //= n
                ret.add(n)
        if x != 1:
            ret.add(x)
        return ret

    a_primes = factorize(a)
    b_primes = factorize(b)
    shared = a_primes.intersection(b_primes)
    print(len(shared) + 1)


main()
n,X = map(int,input().split())
x = list(map(int,input().split()))
x.append(X)
x.sort()
a=[]
for i in range(n-1):
        a.append(x[i+1]-x[i])        

def gcd(m,n):
        while n!=0:
                s = m%n
                m = n
                n = s
        return m

ans=min(a)
for j in a:
        if j%min(a) != 0:
                ans = gcd(j,ans)
print(ans)

### FIXED CODE ###

n,X = map(int,input().split())
x = list(map(int,input().split()))
x.append(X)
x.sort()
a=[]
for i in range(len(x)-1):
        a.append(x[i+1]-x[i])        

def gcd(m,n):
        while n:
                m,n = n,m%n
        return m

ans=a[0]
for j in a:
        if j%ans != 0:
                ans = gcd(j,ans)
print(ans)
n,m = input().split(" ")
n = int(n)
m = int(m)
ans = -1
ans1 = ['0']*n
for i in range(m):
    si, ci = input().split(" ")
    si=int(si)
    if(ans1[si-1]=='0'):
        ans1[si-1]=ci
    elif(ans1[si-1]>ci):
        ans1[si-1]=ci
        
if(ans1[0]!='0'):
    ans = int(('').join(ans1))
elif(int(('').join(ans1))==0)
    ans=0
print(ans)    

### FIXED CODE ###

n, m = list (map (int, input ().split ()))
d = [-1 for i in range (n + 1)]
flg = True

for i in range (m) :
    s, c = list (map (int, input ().split ()))
    if (flg) :
        if (d[s] != -1 and d[s] != c) :
            flg = False
            continue
        d[s] = c

if (d[1] == 0 and n > 1) :
    flg = False

if (flg and n > 1) :
    for i in range (1, n + 1) :
        if (d[i] == -1) :
            if (i == 1) :
                d[i] = 1
            else :
                d[i] = 0

if (n == 1 and d[1] == -1) :
    d[1] = 0

print (''.join (list (map (str, d[1:]))) if flg else "-1")
import math
import itertools
 
n = int(input())
a = list(map(int,input().split()))
a.sort()

ans = 0
for i in range(n-2):
    x = a[i]
    for j in range(i+1,n-1):
        y = a[j]
        for k in range(j+1,n):
            if a[k] < x+y
                ans += 1
            else:
                break

print(ans) 
            

### FIXED CODE ###

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

ans = 0
for i in range(n-2):
    for j in range(i+1,n-1):
        index = bisect.bisect_left(a,a[i]+a[j])
        ans += index-j-1
        
print(ans)
n=int(input())
a=[int(x)for x in input().split()]
c=[0]*n
for e in a:c[e-1]+=1
for e in c:print(e)

### FIXED CODE ###

import math
print(2.*math.pi*int(input()))
n,m = map(int,input().split())
sc = [tuple(map(int,input().split())) for i in range(m)]
l = [0]*n
for t in sc:
    l[t[0]-1] = t[1]
if sc[0][0]!=1 and sc[0][1]==0:
    l[0]=1
    print("".join([str(s) for s in l]))
elif l[0]==0:
    print(-1)
else:
    print("".join([str(s) for s in l]))

### FIXED CODE ###

n,m = map(int,input().split())
x = [tuple(map(int,input().split())) for i in range(m)]
f=True
for i in range(0,1001):
    i = str(i)
    if len(i)==n:
        if all([i[t[0]-1]==str(t[1]) for t in x]):
            print(i)
            f=False
            break
if f:
    print(-1)
N, M = map(int,input().split())

v = list(range(1,M+1))
edges = [[] for _ in range(M+1)]
for _ in range(M):
  a, b = map(int,input().split())
  edges[a] += [b]
  edges[b] += [a]

def dfs(v, e):
  for x in v:
    if(len(e[x]) == 1):
      t = e[x][0]
      e[x] = []
      e[t].remove(x)
      v.remove(x)
      return dfs(v, e)+1
  return 0

print(dfs(v, edges))

### FIXED CODE ###

N, M = map(int,input().split())

v = [i for i in range(1,N+1)]
e = [[]]*(N+1)
for i in range(M):
  a, b = map(int,input().split())
  e[a] = e[a] + [b]
  e[b] = e[b] + [a]

def dfs(v, e):
  for num in v:
    if(len(e[num]) == 1):
      tmp_num = e[num][0]
      v.remove(num)
      e[num] = []
      e[tmp_num].remove(num)
      #print(e,v)
      return dfs(v, e)+1
  return 0
print(dfs(v, e))
n = int(input())
S = list(map(int, input().split()))
q = int(input())
T = list(map(int, input().split()))

print(len(S&T))

### FIXED CODE ###

n = int(input())
S = set(input().split())
q = int(input())
T = set(input().split())

print(len(S&T))
n, a, b = map(int, input().split())

n_cond = 0
for i in range(n+1):
  i_str = str(i)
  order_sum = map(sum, i_str)
  if order_sum >= a and order_sum <= b:
    n_cond += 1

### FIXED CODE ###

from functools import reduce 
from operator import add
n, a, b = map(int, input().split())

n_cond = 0

for i in range(1, n+1):
  i_str = str(i)

  if len(i_str) == 1:
    order_sum = i
    
  else:
    temp = list(map(int, i_str))
    order_sum = reduce(add, temp)
    
  if order_sum >= a and order_sum <= b:
    n_cond += i
print(n_cond)
'''
a,op,b = input().split()

a,b = int(a),int(b)
'''
###############################################################
#whileの中に入れないと同じデータセットでの計算をずっとし続ける#
###############################################################

while True:
	a,op,b = input().split()

	a= int(a)
	b = int(b)

	if op == +:
		print(a+b)
	elif op == -:
		print(a-b)
	elif op == *:
		print(a*b)
	elif op == /:
		print(a/b)
	elif op == ?:
		break



### FIXED CODE ###

'''
a,op,b = input().split()

a,b = int(a),int(b)
'''
###############################################################
#whileの中に入れないと同じデータセットでの計算をずっとし続ける#
###############################################################

while True:
	a,op,b = input().split()

	a= int(a)
	b = int(b)

	if op == '+':
		print(a+b)
	elif op == '-':
		print(a-b)
	elif op == '*':
		print(a*b)
	elif op == '/':
		print(a//b)
	elif op == '?':
		break
N, A, B = [int(i) for i in input().split()]

ans = []
for _ in range(N//(A+B)+1):
    ans.append("b"*A)
    ans.append("r"*B)
        
ans = "".join(ans)
print(ans[:N].count("b"))

### FIXED CODE ###

N, A, B = [int(i) for i in input().split()]
ans = N // (A + B) * A
r = N % (A + B)
print(ans+min(r, A))
W,H,x,y=map(int,input().split());print(W*H/2,(W%x==0 and H%y==0)*1)

### FIXED CODE ###

W,H,x,y=map(int,input().split());print(W*H/2,1*(W/2==x and H/2==y))
N = int(raw_input())
num_list = map(int, raw_input().split())
c = 0
flag = 1
while flag:
    flag =0
    for j in range(N-1,0,-1):
        if num_list[j] < num_list[j-1]:
            a = num_list[j]
            num_list[j] = numlist[j-1]
            num_list[j-1] = a
            c += 1
            flag =1
print " ".join(map(str,num_list))
print c

### FIXED CODE ###

N = int(raw_input())
num_list = map(int, raw_input().split())

c = 0
flag = 1
while flag==1:
    flag =0
    for j in range(N-1,0,-1):
        if num_list[j] < num_list[j-1]:
            a = num_list[j]
            num_list[j] = num_list[j-1]
            num_list[j-1] = a
            c += 1
            flag =1

print " ".join(map(str,num_list))
print c
N = int(input())

if N == 1:
	answer = "Hello World"
    print(answer)
elif N == 2:
	A,B = map(int,input().split())
	answer = A + B
	print(int(answer))

### FIXED CODE ###

N = int(input())

if N == 1:
	answer = "Hello World"
	print(answer)
elif N == 2:
	A = int(input())
	B = int(input())
	answer = A + B
	print(answer)
import math

r =float(input())


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))
n = input()
a = list(map(int, input().split()))
b = sum(a)
sum = 0

for i in range(n):
    b -= a[i]
    sum += a[i]*b   

print(sum%(10**9+7))

### FIXED CODE ###

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

for i in range(len(a)):
    b -= a[i]
    sum += a[i]*b   

print(sum%(10**9+7))
n = int(input())
a = list(map(int, input(),split()))
sa = set(a)
if len(a) == len(sa):
  print("YES")
else:
  print("NO")

### FIXED CODE ###

n = int(input())
a = list(map(int, input().split()))
sa = set(a)
if len(a) == len(sa):
  print("YES")
else:
  print("NO")
N, K = list(map(int,input().split()))
k = K - 1
H = list(map(int,input().split()))
Hs = sorted(H,reverse = True)
for i in range(0,K):
  Hs[i] = 0
print(sum(Hs))

### FIXED CODE ###

N, K = list(map(int,input().split()))
k = K - 1
H = list(map(int,input().split()))
Hs = sorted(H,reverse = True)
if K <= N:
  for i in range(0,K):
    Hs[i] = 0
  print(sum(Hs))
if K > N:
  print(0)
S = input()
ans = 0
for s in S:
    i = int(s)
    ans += min(i, 10-i)
if S[0] == '9' or int(S[1]) >= 6:
    ans += 1
print(ans)


### FIXED CODE ###

S = input()
dp = [0, 1]
for s in S:
    i = int(s)
    a = min(dp[0] + i,   dp[1] + 10 - i)
    b = min(dp[0] + i+1, dp[1] + 10 - (i+1))
    dp = [a, b]
    # print(dp)
print(dp[0])
elements = [1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51]
th = K-1
print(elements[th])         

### FIXED CODE ###

elements = [1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51]
K = int(input())
th = K-1
print(elements[th])
N = int(input())
dicta = {}
for i in range(N):
    word = input()
    dicta.setdefault(word, 0)
    dicta[word] += 1
word_c = list(dicta.items())
word_c.sort(key=lambda tup: tup[1], reverse=True)
max_len_word = [word_c[0][0]]
for j in range(1,N):
    if word_c[j][1] == word_c[0][1]:
        max_len_word.append(word_c[j][0])
    else:
        break
max_len_word.sort()
for word in max_len_word:
    print(word)

### FIXED CODE ###

N = int(input())
dicta = {}
for i in range(N):
    word = input()
    dicta.setdefault(word, 0)
    dicta[word] += 1
word_c = list(dicta.items())
word_c.sort(key=lambda tup: tup[1], reverse=True)
max_len_word = [word_c[0][0]]
for j in range(1,len(word_c)):
    if word_c[j][1] == word_c[0][1]:
        max_len_word.append(word_c[j][0])
    else:
        break
max_len_word.sort()
for word in max_len_word:
    print(word)
import collections 

w=input()

l=collections.Counter(list(w))
l=list(l.values())
flg=0
for i in range(len(l)):
    if l[i]%2!=0:
        flg+=1

if flg==0:
    print('Yes')
else:
    pritn('No')


### FIXED CODE ###


w=input()

import collections 

l=collections.Counter(list(w))
l=list(l.values())

flg=0
for i in range(len(l)):
    if l[i]%2!=0:
        flg+=1

if flg==0:
    print('Yes')
else:
    print('No')
s = input()
b = 0
w = 0
for i in range(n):
    if s[i] == '.':
        b += 1
    else:
        w += 1
print(min(b, w))

### FIXED CODE ###

n = int(input())
s = input()
b = 0
w = 0
for i in range(n):
    if s[i] == '.':
        b = min(b,w) + 1
    else:
        b = min(b, w)
        w += 1
print(min(b, w))
x = int(input())
i = -1
while (i + 1) ** 5 - i ** 5 < x:
    i += 1
    j = i
    while i ** 5 - j ** 5 < x:
        j -= 1
        #print(i, j)
        if i ** 5 - j ** 5 == 0:
            break
    else:
        continue
    break
print(i, j)

### FIXED CODE ###

x = int(input())
a = 0
if x == 0:
    print(0, 0)
else:
    while a ** 5 - (a - 1) ** 5 <= x:
        a += 1
        b = a
        while a ** 5 - b ** 5 < x:
            b -= 1
            if a ** 5 - b ** 5 == x:
                break
        else:
            continue
        break
    print(a, b)
N = input()
S = 0
for n in N:
  S += n
N = int(N)
print("Yes" if N%S == 0 else "No")

### FIXED CODE ###

N = input()
mylist = []
for i in range(len(N)):
  mylist.append(N[i])
newlist = [int(s) for s in mylist]
divisor = 0
for j in range(len(newlist)):
  divisor += newlist[j]
N = int(N)
if N%divisor == 0:
  print("Yes")
else:
  print("No")
if "AC" in input() == True:
    print("Yes")
else:
    print("No")if "AC" in input() == True:

### FIXED CODE ###

answer = "AC" in input()
if answer == False:
    print("No")
else:
    print("Yes")
n=int(input())
list=[]
for i in range(n):
  s,p=input().split()
  list.append((s, -int(p), i+1))
list.sort()
for s,p,i in list:
  print(i)

### FIXED CODE ###

a,p = map(int,input().split())
print((3*a+p)//2)
N = int(input())
import numpy as np
a = np.empty((26,15))
for i in range(26):
  for j in range(15):
    a[i][j] = 4 * i + 7 * j

if N in a:
  print('Yes')
else:
  print('No')

### FIXED CODE ###

N, K = map(int, input().split())
r = N % K
if r == 0:
  print(0)
else:
  print(1)
import math

def lcm(x, y):
    return (x * y) // math.gcd(x, y)


number =str(input())
numbers = number.split(" ")
A = int(numbers[0])
B = int(numbers[1])
C = int(numbers[2])
D = int(numbers[3])

number = B - A + 1

answer_C = number / C

answer_D = number / D

answer_E = number / lcm(C,D)
final_answer = number - answer_C - answer_D + answer_E
print(int(final_answer))

### FIXED CODE ###

import fractions

A,B,C,D = map(int, input().split())
lcm_number = C*D // fractions.gcd(C, D)
all_number = B -A + 1

answer_C = B // C - (A-1) // C
answer_D = B // D - (A-1) // D
answer_lcm = B // lcm_number - (A-1) // lcm_number

print(all_number - answer_C - answer_D + answer_lcm)
import math

import numpy as np


def get_pseudo_input():
    N = 3
    A = np.array([6, 10, 16])
    return N, A


def get_input():
    N = int(input())
    A = np.array([int(x) for x in input().split()])
    return N, A


def sieve_of_eratosthenes(x: int):
    ret = np.full(x + 1, -1)
    for i in range(1, x + 1):
        ret[i] = i
    p_max = int(math.sqrt(x))
    for p in range(2, p_max + 1):
        if ret[p] < p:  # p is not a prime number
            continue
        for i in range(p, x + 1, p):
            if ret[i] > p:
                ret[i] = p
    return ret


A_max = 10 ** 6
p_table = sieve_of_eratosthenes(A_max)

N, A = get_input()
# Store a number of unique Ais using the prime number
p_nums = np.zeros(A_max + 1)
p_nums[1] = N
max_p_nums = 0
for a in A:
    # print(f"a={a}")
    while a > 1:
        p = p_table[a]
        while a % p == 0:
            a = a // p
        # print(f"  a={a}")
        p_nums[p] += 1
        if max_p_nums < p_nums[p]:
            max_p_nums = p_nums[p]
# print(max_p_nums)
if max_p_nums <= 1:
    # GCD of A is 1
    print("pairwise coprime")
elif max_p_nums == N:
    # GCD of A is not 1
    print("not coprime")
else:
    print("setwise coprime")

### FIXED CODE ###

import math


def get_pseudo_input():
    N = 3
    A = [6, 10, 16]
    return N, A


def get_input():
    N = int(input())
    A = [int(x) for x in input().split()]
    return N, A


def sieve_of_eratosthenes(x: int):
    ret = [-1] * (x + 1)
    for i in range(1, x + 1):
        ret[i] = i
    p_max = int(math.sqrt(x))
    for p in range(2, p_max + 1):
        if ret[p] < p:  # p is not a prime number
            continue
        for i in range(p, x + 1, p):
            if ret[i] > p:
                ret[i] = p
    return ret


A_max = 10 ** 6
p_table = sieve_of_eratosthenes(A_max)

N, A = get_input()
# Store a number of unique Ais using the prime number
p_nums = [0] * (A_max + 1)
p_nums[1] = N
max_p_nums = 0
for a in A:
    # print(f"a={a}")
    while a > 1:
        p = p_table[a]
        while a % p == 0:
            a = a // p
        # print(f"  a={a}")
        p_nums[p] += 1
        if max_p_nums < p_nums[p]:
            max_p_nums = p_nums[p]
# print(max_p_nums)
if max_p_nums <= 1:
    # GCD of A is 1
    print('pairwise coprime')
elif max_p_nums == N:
    # GCD of A is not 1
    print('not coprime')
else:
    print('setwise coprime')
a,b=map(int,input().split())
if a<b
 print('a<b')
 elif a>b
 print('a>b')
 else
 print('a==b')

### FIXED CODE ###

a, b = map(int,input().split())
 
if a > b:
    print('a > b')
elif a < b:
    print('a < b')
else:
    print('a == b')
n=int(input())
Y=input()
y=list(Y)
last=y[len(y)-1]
m=[]
for i in range(n-1):
    x=input()
    if x in m:
        v=0
    m.append(x)
    z=list(x)
    if last!=z[0]:
        v=0
    last = z[len(y) - 1]
if v==0:
    print('No')
else:
    print('Yes')

### FIXED CODE ###

n = int(input())
words = []
won = True
for i in range(n):
    new_word = input()
    if i > 0 and won:
        if new_word in words or new_word[0] != words[i-1][len(words[i-1])-1]:
            won = False
    words.append(new_word)

if won:
    print("Yes")
else:
    print("No")