Harryxun/stf_run huggingface dataset:
import sys
h,w=map(int,input().split())
s=[]
for num in range(h):
  s.append(list(map(int,input().split())))
if w==1:
  if h==1:
    if s[0]=='#':
      print('No')
      sys.exit()
  else:
    for i in range(h-1):
      if (s[i][0]=='#' and s[i+1][0]=='.') or (s[i][0]=='.' and s[i+1][0]=='#'):
        print('No')
        sys.exit()
if w==2:
  if h==1:
    if (s[0][0]=='.' and s[0][1]=='#') or (s[0][0]=='#' and s[0][1]=='.'):
      print('No')
      sys.exit()  
  else:
    for i in range(h-1):
      if s[i][0]=='.' and s[i][1]=='#':
        if s[i+1][1]=='.':
          print('No')
          sys.exit()
      if s[i][0]=='#' and s[i][1]=='.':
        if s[i+1][0]=='.':
          print('No')
          sys.exit()     
for i in range(h):
  for j in range(w-2):
    if s[i][j]=='.' and s[i][j+1]=='#' and s[i][j+2]=='.':
      if s[i][j+1]=='.':
        print('No')
        sys.exit()
    if s[i][0]=='#' and s[i][1]=='.':
      if s[min(h-1,i+1)][0]=='.':
        print('No')
        sys.exit()
    if s[i][w-2]=='.' and s[i][w-1]=='#':
      if s[min(h-1,i+1)][w-1]=='.':
        print('No')
        sys.exit()
print('Yes')
  


### FIXED CODE ###

h, w = map(int, input().split())

s = [input() for _ in range(h)]

ans = 'Yes'

for i in range(1, h-1):
    for j in range(1, w-1):
        if s[i][j] == '#' and s[i-1][j] == '.' and s[i+1][j] == '.' and s[i][j-1] == '.' and s[i][j+1] == '.':
            ans = 'No'

print(ans)
n, m = map(int, input().split())
in_list = input().split
vote_list = [int(i) for i in in_list]

ans = 0
for ai in vote_list:
    if ai >= 1/(4*m)*sum(vote_list):
        ans += 1

if ans < m :
    print('no')
else:
    print('yes')

### FIXED CODE ###

n, m = map(int, input().split())
in_list = input().split()
vote_list = [int(i) for i in in_list]

ans = 0
for ai in vote_list:
    if ai >= 1/(4*m)*sum(vote_list):
        ans += 1

if ans < m :
    print('No')
else:
    print('Yes')
import sys
input=sys.stdin.readline
n,p=map(int,input().split())
l=list(input())
for i in range(n):
    l[i]=int(l[i])
w=0
wl=[]
po=pow(10,p-2,p)
for i in range(n):
    wl.append(w)
    #if w==0:
        #ans+=rr[n-1-i]
    w-=l[n-1-i]
    w*=po
    w%=p
wl.reverse()
r=[]
rt=0
for i in range(n):
    rt+=l[n-1-i]*(10**i)
    r.append(rt%p)
r.reverse()
d=tuple(0 for i in range(p))
ans=0
for i in range(n):
    d[r[i]]+=1
    ans+=d[wl[i]]  
print(ans)


### FIXED CODE ###

import sys,bisect
input = sys.stdin.readline

n,p = map(int,input().split())
s = list(input())
for i in range(n):
    s[i] = int(s[i])
    
if p == 2 or p == 5:
    res = 0
    for i in range(n):
        if s[i]%p == 0:
            res += i+1
    print(res)
else:
    d = 1
    q = [0]
    for i in range(n-1,-1,-1):
        q.append((q[-1]+s[i]*d)%p)
        d = d*10%p
    q.sort()
    res = 0
    q.append(-1)
    f = 1
    for i in range(n+1):
        if q[i]==q[i+1]:
            f += 1
        else:
            res += f*(f-1)//2
            f=1
    print(res)
h, w = list(map(int, input().split()))

s = [list(input()) for _ in range(w)]

flag = True

for i in range(h):
    for j in range(w):
        if s[i][j] == "#":
            sub_flag = False
            if i > 0 and s[i-1][j] == "#":
                sub_flag = True
            if j > 0 and s[i][j-1] == "#":
                sub_flag = True
            if i < h-1 and s[i+1][j] == "#":
                sub_flag = True
            if j < w-1 and s[i][j+1] == "#":
                sub_flag = True
            if sub_flag:
                pass
            else:
                flag = False
                break

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

### FIXED CODE ###

h, w = list(map(int, input().split()))

s = [list(input()) for _ in range(h)]

flag = True

for i in range(h):
    for j in range(w):
        if s[i][j] == "#":
            sub_flag = False
            if i > 0 and s[i-1][j] == "#":
                sub_flag = True
            if j > 0 and s[i][j-1] == "#":
                sub_flag = True
            if i < h-1 and s[i+1][j] == "#":
                sub_flag = True
            if j < w-1 and s[i][j+1] == "#":
                sub_flag = True

            if sub_flag:
                pass
            else:
                flag = False
                break

if flag:
    print("Yes")
else:
    print("No")
import collections
import numpy as np

h, w, m = map(int, input().split())
lst_ = []
for i in range(m):
    h, m = map(int, input().split())
    lst_.append([h, m])

lst = np.array(lst_)
h_lst = collections.Counter(lst[:,0])
w_lst = collections.Counter(lst[:,1])

def get_cand(sub_lst):
    sub_lst = sub_lst.most_common()
    cand = []
    for sub in sub_lst:
        if sub[1] != sub_lst[0][1]:
            break
        cand.append(sub[0])
    return cand, sub_lst[0][1]

h_cand, h_count = get_cand(h_lst)
w_cand, w_count = get_cand(w_lst)

flag = False
for h in h_cand:
    if flag:
        break
    for w in w_cand:
        if not [h,w] in lst_:
            #print("bomber: ", h_count, w_count)
            flag = True
            break
ans = h_count + w_count
if flag:
    print(ans)
else:
    print(ans-1)





### FIXED CODE ###

import collections
import numpy as np

h, w, m = map(int, input().split())
lst_ = []
h_lst = [0]*h
w_lst = [0]*w
for i in range(m):
    h_, w_ = map(int, input().split())
    lst_.append([h_, w_])
    h_lst[h_-1] += 1
    w_lst[w_-1] += 1

h_count = max(h_lst)
w_count = max(w_lst)
h_cand = set([i+1 for i, h_ in enumerate(h_lst) if h_ == h_count])
w_cand = set([i+1 for i, w_ in enumerate(w_lst) if w_ == w_count])
#print(h_cand, w_cand)

count = 0
for bomb in lst_:
    if bomb[0] in h_cand and bomb[1] in w_cand:
        count += 1

ans = max(h_lst) + max(w_lst)
if count < len(h_cand)*len(w_cand):
    print(ans)
else:
    print(ans-1)
import fileinput

if __name__ == '__main__':

    for i in fileinput.input():
        a.append(i)
    
    for i in a:
        b = i.split()
        b = map(float, b)

        b_a = b[0]
        b_b = b[1]
        b_c = b[2]
        b_d = b[3]
        b_e - b[4]
        b_f = b[5]
 
        b_d = b_a
        b_e = b_a/b_d * b_e
        b_f = b_a/b_d * b_f

        x = (b_c - b_f)/(b_b - b_e)

        y = (b_c - x * b_b)/b_a 

        print round(x, 3)

### FIXED CODE ###

while 1:
    def solver(a, b, c, d, e, f):
        answer = []

        if d == 0:
            y = f / e
            x = (c - b * y)/a

        else:
            m = a / d

            d = d * m
            e = e * m
            f = f * m

            y = (c - f)/(b - e)

            x = (c - b * y)/a

            if x == -0:
                x = 0
            if y == -0:
                y = 0

        answer.append(x)
        answer.append(y)
        return answer

    try:
        p_1, p_2, p_3, p_4, p_5, p_6 = map(float, raw_input().split())

        ans = []
        ans = solver(p_1, p_2, p_3, p_4, p_5, p_6)

        print "%.3f %.3f" % (ans[0], ans[1])

    except:
        break
import sys
sys.setrecursionlimit=10**12

def modinv(a,m=10**9+7):
    if a==0: return 1
    else:
        b=m
        (x, lastx) = (0, 1)
        (y, lasty) = (1, 0)
        while b != 0:
            q = a // b
            (a, b) = (b, a % b)
            (x, lastx) = (lastx - q * x, x)
            (y, lasty) = (lasty - q * y, y)
        return lastx % m

def cur(p):
    for x in neighbor[p]:
        par[x]=p
        neighbor[x].remove(p)
        try:
            descend[p]+=cur(x)
        except: sys.exit()
    return descend[p]

def cur2(p):
    for x in neighbor[p]:
        ans[x]=ans[p]*descend[x]*modinv(n-descend[x])
        ans[x]%=mod
        cur2(x)

mod=10**9+7
n=int(input())
neighbor=[set()  for _ in range(n+1)]
descend=[1]*(n+2)
par=[-1]+[0]*n

for _ in range(n-1):
    a,b=map(int,input().split())
    neighbor[a].add(b)
    neighbor[b].add(a)
cur(1)


ans=[1]*(n+1)
ans1=1
for i in range(1,n+1):
    ans1=ans1*i*modinv(descend[i])
    ans1%=mod
ans[1]=ans1

cur2(1)

for i in range(1,n+1):
    print(ans[i])

### FIXED CODE ###

s=input()
print("Yes" if s[2]==s[3] and s[4]==s[5] else "No")
N, M = map(int, input().split(' '))
X = []
for i in range(N):
    X.append(list(map(int, input().split(' '))))

num_b = [i+1 for i in range(N)]
psb = [0]*N
psb[0] = 1

for i in X:
    num_b[[i][0]] -= 1
    num_b[[i][1]] += 1
    if num_b[[i][0]] == 0:
        psb[[i][0]] = 0
    if psb[[i][0]] == 1:
        psb[[i][1]] == 1 

print(psb.count(1))

### FIXED CODE ###

N, M = map(int, input().split(' '))
X = []
for i in range(M):
    X.append(list(map(int, input().split(' '))))

num_b = [1 for i in range(N+1)]
num_b[0] = 0
psb = [0]*(N+1)
psb[1] = 1
for i in range(M):
    num_b[X[i][0]] -= 1
    num_b[X[i][1]] += 1
    if psb[X[i][0]] == 1:
        psb[X[i][1]] = 1 
    if num_b[X[i][0]] == 0:
        psb[X[i][0]] = 0

print(psb.count(1))
tr_in = input()
print(str_in.swapcase())


### FIXED CODE ###

str_in = input()
print(str_in.swapcase())
X = int(input())

for A in range(100):
  C = A ** 5 - X
  B = C ** 0.2
  if B % 1 == 0:
    print(str(A) + " " + str(B))
    break
    
for B in range(100):
  C = B ** 5+ X
  A = C ** 0.2
  if A % 1 == 0:
    print(str(A) + " " + str(B))
    break


### FIXED CODE ###

X = int(input())
for A in range(-120, 120):
  for B in range(-120, 120):
    if A**5 - B**5 == X:
      print(str(A) + " " + str(B))
      quit()
N=int(input())
A=[int(input()) for i in range(N)]
list.sort(A,reverse=True)
a=0
b=0
for i in range(N):
    if(i%2==0):
        a+=A[i]
    else:
        b+=A[i]
print(a-b)

### FIXED CODE ###

N=int(input())
A= list(map(int,input().split()))
list.sort(A,reverse=True)
a=0
b=0
for i in range(N):
    if(i%2==0):
        a+=A[i]
    else:
        b+=A[i]
print(a-b)
from collections import deque

N,M = [int(v) for v in input().split()]
ad_list = [[] for _ in range (N+1)]
ad_num = [0 for _ in range(N)]
topo = []

for _ in range(N-1+M):
    l,r = [int(v) for v in input().split()]
    ad_list[l].append(r)
    ad_num[r-1] += 1

for i in range(1,N+1):
    if ad_num[i-1] == 0:
        topo.append(i)
queue = deque(topo[:])
topo = [[0,topo[0]]]
while queue:
    n1 = queue.popleft()
    for n2 in ad_list[n1]:
        ad_num[n2-1] -= 1
        if ad_num[n2-1] == 0:
            topo.append([n1,n2])
            queue.append(n2)
topo.sort(key=lambda x:x[1])
for i,v in topo:
    print(i)
#  visited = [False for _ in range(N)]

#  ans = 0
#  path_len = 0
#  def dfs(node,cnt=1):
    #  global ans
    #  if visited[node-1]: return 0
    #  visited[node-1] = True
    #  ans = max(ans,cnt)
    #  for n in ad_list[node]:
        #  dfs(n,cnt+1)

#  for n in range(1,N+1):
    #  dfs(n)
#  print(ans)


### FIXED CODE ###

from collections import deque

N,M = [int(v) for v in input().split()]
ad_list = [[] for _ in range (N+1)]
ad_num = [0 for _ in range(N)]
topo = []

for _ in range(M):
    l,r = [int(v) for v in input().split()]
    ad_list[l].append(r)
    ad_num[r-1] += 1

for i in range(1,N+1):
    if ad_num[i-1] == 0:
        topo.append([i,0])
queue = deque(topo[:])
while queue:
    n1,cnt = queue.popleft()
    for n2 in ad_list[n1]:
        ad_num[n2-1] -= 1
        if ad_num[n2-1] == 0:
            topo.append([n2,cnt+1])
            queue.append([n2,cnt+1])
print(max([v[1] for v in topo]))
s = str(input())
t = str(input())

T = t[：-1]

### FIXED CODE ###

s = str(input())
t = str(input())

if s == t[:-1]:
	print("Yes")
else:
  	print("No")
s = list(input())
flag = True
ans == True
if len(s) == 1:
        ans = False
if len(s) != 1:
    while s :
        if flag:
            if s.pop() == 'i':
                ans = True
                flag = False
            else:
                ans = False
                break
        else:
            if s.pop() == 'h':
                ans = True
                flag = True
            else:
                ans = False
                break
if ans:
    print('Yes')
else:
    print('No')

### FIXED CODE ###

s = input()
ans = False
if len(s) < 1 or len(s) >10:
    ans = False
if len(s) >= 1 or len(s) <= 10:
    if s == 'hi' or s == 'hihi' or s == 'hihihi' or s == 'hihihihi' or s == 'hihihihihi':
        ans =True
    else:
        ans =False
if ans:
    print ('Yes')
else:
    print('No')
#単体変更, 区間取得

class RMQ:
    #INF = int(1e18)
    INF = int((1<<31)-1)
    n = 0
    n_ = 0
    val = []
    def __init__(self, n_):
        n = 1
        while n < n_:
            n = n * 2
        self.n = n
        self.n_ = n_
        self.val = [self.INF] * (2 * n - 1)

    @staticmethod
    def merge(a, b):
        return min(a, b)
        
    def update(self,k, x):
        k = k + self.n - 1
        self.val[k] = x
        while k:
            k = k//2
            self.val[k] = self.merge(self.val[k*2+1], self.val[k*2+2])

    def dfs(self, a, b, k, l, r):
        if r <= a or b <= l:
            return self.INF
        if a <= l and r <= b:
            return self.val[k]
        vl = self.dfs(a, b, k * 2 + 1, l, (l+r)//2)
        vr = self.dfs(a, b, k * 2 + 2, (l+r)//2, r)
        return self.merge(vl, vr)
    

    def query(self, a, b):
        return self.dfs(a, b, 0, 0, self.n)

    
n, q = list(map(int, input().split()))
rmq = RMQ(n)

while q:
    q = q - 1
    com, x, y = list(map(int, input().split()))
    if com == 0:
        rmq.update(x, y)
    else:
        print (rmq.query(x, y + 1))



### FIXED CODE ###

#単体変更, 区間取得

class RMQ:
    #INF = int(1e18)
    INF = int((1<<31)-1)
    n = 0
    n_ = 0
    val = []
    def __init__(self, n_):
        n = 1
        while n < n_:
            n = n * 2
        self.n = n
        self.n_ = n_
        self.val = [self.INF] * (2 * n - 1)

    @staticmethod
    def merge(a, b):
        return min(a, b)
        
    def update(self,k, x):
        k = k + self.n - 1
        self.val[k] = x
        while k:
            k = (k-1)//2
            self.val[k] = self.merge(self.val[k*2+1], self.val[k*2+2])

    def dfs(self, a, b, k, l, r):
        if r <= a or b <= l:
            return self.INF
        if a <= l and r <= b:
            return self.val[k]
        vl = self.dfs(a, b, k * 2 + 1, l, (l+r)//2)
        vr = self.dfs(a, b, k * 2 + 2, (l+r)//2, r)
        return self.merge(vl, vr)
    

    def query(self, a, b):
        return self.dfs(a, b, 0, 0, self.n)

    
n, q = list(map(int, input().split()))
rmq = RMQ(n)

query = rmq.query
update = rmq.update
while q:
    q = q - 1
    com, x, y = list(map(int, input().split()))
    if com == 0:
        update(x, y)
    else:
        print (query(x, y + 1))
# -- coding: utf-8 --
from collections import deque
N = int(input())
red = []
for i in range(N):
    red.append(list(map(int, input().split(' '))))
blue = []
for i in range(N):
    blue.append(list(map(int, input().split(' '))))
red.sorted()
blue.sorted()
red = deque(red)
blue = deque(blue)
count = 0
flag = [0] * N
for b in blue:
    for i, r in enumerate(red):
        if r[0] < b[0] and r[1] < b[1] and flag[i] == 0:
            count += 1
            flag[i] = 1

print(count)

### FIXED CODE ###

# -- coding: utf-8 --
from collections import deque
N = int(input())
red = []
for i in range(N):
    red.append(list(map(int, input().split(' '))))
blue = []
for i in range(N):
    blue.append(list(map(int, input().split(' '))))
red = deque(sorted(red, key=lambda x:(x[1], x[0]), reverse=True))
blue = deque(sorted(blue))
count = 0
flag = [0] * N
for b in blue:
    for i, r in enumerate(red):
        if r[0] < b[0] and r[1] < b[1] and flag[i] == 0:
            count += 1
            flag[i] = 1
            break

print(count)
mod = 1000000007
dp=[]
def countways(n,broken,index):
	global dp,mod
	if(dp[index]!=-1):
		return dp[index]

	ways = 0
	if(index+1<=n and broken[index+1]==0):
		ways+=countways(n,broken,index+1)
	if(index+2<=n and broken[index+2]==0):
		ways+=countways(n,broken,index+2)
	dp[index]=(ways%mod)
	return dp[index]

n,m = list(map(int,input().split()))
dp = [-1 for i in range(n+1)]
dp[n] = 1
broken = [0 for i in range(n+1)]
for i in range(m):
	broken[int(input())]=1
print(countways(n,broken,0)%mod)

### FIXED CODE ###

md = 1000000007
n,m = list(map(int,input().split()))
broken = [0 for i in range(n+1)]
dp=[0 for i in range(n+1)]
dp[0] = 1
for i in range(m):
	broken[int(input())]=1
# print(brok	en)
for j in range(1,n+1):
	if(broken[n-j]==1):
		continue
	if(j==1):
		dp[j]=1
	else:
		dp[j]=(dp[j-1]+dp[j-2])%md
# print(dp)
print(dp[n]%md)
def inputs(num_of_input):
    ins = [input() for i in range(num_of_input)]
    return ins


def solve(inputs):
    [N, M] = list(map(lambda x: int(x), inputs[0].split()))
    broke_steps = list(map(lambda x: int(x), inputs[1:]))

    prev = broke_steps[0]
    for broke_step in broke_steps[1:]:
        if broke_step - prev == 1:
            return 0

    SSSS = 1000000007

    patterns = [0]
    for i, step in enumerate(reversed(range(1, N))):
        if step in broke_steps:
            ap = 0
        elif step == N - 1:
            ap = 1
        elif step == N - 2:
            ap = 2
        else:
            ap = patterns[i] + patterns[i - 1]
        patterns.append(ap)

    return (patterns[-1] + patterns[-2]) % SSSS


if __name__ == "__main__":
    first = input()
    [N, M] = list(map(lambda x: int(x), first.split()))
    inputs_str = inputs(M)
    inputs_str.insert(0, first)
    ret = solve(inputs_str)
    print(ret)


### FIXED CODE ###

def inputs(num_of_input):
    ins = [input() for i in range(num_of_input)]
    return ins


def solve(inputs):
    [N, M] = list(map(lambda x: int(x), inputs[0].split()))
    broke_steps = {}
    for b in map(lambda x: int(x), inputs[1:]):
        broke_steps[b] = True

    SSSS = 1000000007

    patterns = [1]
    for step in range(1, N + 1):
        if step in broke_steps:
            ap = 0
        elif step == 1:
            ap = 1
        else:
            ap = (patterns[step - 1] + patterns[step - 2]) % SSSS
        patterns.append(ap)

    return patterns[-1]


if __name__ == "__main__":
    first = input()
    [N, M] = list(map(lambda x: int(x), first.split()))
    inputs_str = inputs(M)
    inputs_str.insert(0, first)
    ret = solve(inputs_str)
    print(ret)
# -*- coding: utf-8 -*-
# 整数の入力
n = int(raw_input())
li = list(map(int, input().split()))

for i in range(n):
    sl.append("".join(sorted(list[i])))

sl.sort()

c = collections.Counter(sl)

print(N - (len(c)-1))

### FIXED CODE ###

# -*- coding: utf-8 -*-
N = int(raw_input())
cnt = 0
dic = {}

for _ in xrange(N):
	rs = ''.join(sorted(raw_input()))
	
	if rs in dic:
		cnt += dic[rs]
		dic[rs] += 1
	else:
		dic[rs] = 1
print cnt
s = list(input())
for i in range[3]:
  if (s[i] == s[i] + 1):
  print('Bad')
  exit()
else:
  print('Good')


### FIXED CODE ###

S = list(input())
for i in range(3):
    if(S[i]==S[i+1]):
        print('Bad')
        exit()
else:
    print('Good')
N, M = list(map(int, input().split()))

As = list(map(int, input().split()))
As.sort()

BCs = []
for _ in range(M):
  b, c = tuple(map(int, input().split()))
  BCs.append((b, c))
BCs.sort(key=lambda x: x[1], reverse=True)
  
num = 0
i = 0
for b, c in BCs:
  for j in range(b):
    a = As[i]
    if a >= c or i == len(As):
      break
    else:
      num += c
      i += 1
  if a >= c or i == len(As):
    break
num += sum(As[i: ])
    
print(num)

### FIXED CODE ###

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

As = list(map(int, input().split()))
As.sort()

BCs = []
for _ in range(M):
  b, c = tuple(map(int, input().split()))
  BCs.append((b, c))
BCs.sort(key=lambda x: x[1], reverse=True)
  
num = 0
i = 0
for b, c in BCs:
  for j in range(b):
    a = As[i]
    
    if a >= c:
      break
    else:
      num += c
      i += 1
      
    if i == len(As):
      break
      
  if a >= c or i == len(As):
    break
num += sum(As[i: ])
    
print(num)
N=input()
ST=input()
S=ST.split(' ')[0]
T=ST.split(' ')[1]

for i in range(N):
  result.append(S[i])
  result.append(T[i])
  
print(result)

### FIXED CODE ###

N=input()
ST=input()
S=ST.split(' ')[0]
T=ST.split(' ')[1]
result=''

for i in range(int(N)):
  result+=S[i]
  result+=T[i]
  
print(result)
import numpy as np
N = int(input())
P = np.array(list(map(int,input().split())))*2
A = np.array([np.zeros(N)]*N)

for i in range(N):
    if i == 0:
        A[0][0] = 1
        A[-1][0] = 1
    else:
        A[i-1][i] = 1
        A[i][i] = 1
        
ans = [int(one) for one in np.dot(np.linalg.inv(A),P)]

ans_s = ""
for one in ans:
    ans_s += "{} ".format(one)
ans_s = ans_s[:-1]

print(ans_s)

### FIXED CODE ###

import numpy as np
N = int(input())
p = np.array(list(map(int,input().split())))
a0 = 0
for i in range(0,N,2):
    a0 += p[i]
    
for i in range(1,N-1,2):
    a0 -= p[i]
    
ans2 = [a0]*N
# iは-1している(slice)ので、+1しないといけないことに注意
for i,one in enumerate(p[1:]):
    ans2[i+1] = 2*p[i] - ans2[i] 
    
ans_s = ""
for one in ans2:
    ans_s += "{} ".format(one)
ans_s = ans_s[:-1]

print(ans_s)
s=input()
ans=""

for i in range(len(a)):
	ans+="x"

print(ans)

### FIXED CODE ###

s=input()
ans=""

for i in range(len(s)):
	ans+="x"

print(ans)
s = input()
if s == "H H" | s == "D D" : 
   print( "H" ) 
else : 
   print( "D" ) 

### FIXED CODE ###

s = input()
if s == "H H" or s == "D D" : 
   print( "H" ) 
else : 
   print( "D" )
n = int(input())
card_list = list(map(int, input().split()))

alice_point = 0
bob_point = 0

def pick_card(card_list):
    # print(card_list)
    max = 0
    max_index = 0
    for i in range(card_list.__len__()):
        # print('-------', i)
        if card_list[i] > max:
            # print('@', i, ':', max, '<', card_list[i])
            max = card_list[i]
            max_index = i
    
    del card_list[max_index]

    # print('----', card_list)

    return max, card_list

def sort_card(card_list: list):
    return sorted(card_list)

turn = 0
sorted_list = sort_card(card_list)
while turn < n:
    # print('--', turn)
    if turn % 2 == 0:
        # alice_get, remain_list = pick_card(card_list)
        # alice_point += alice_get
        alice_point += sorted_list.pop(turn)
    else:
        # bob_get, remain_list = pick_card(card_list)
        # bob_point += bob_get
        bob_point += sorted_list.pop(turn)

    # card_list = remain_list
    print(alice_point, bob_point, card_list)

    turn += 1

print(alice_point - bob_point)

### FIXED CODE ###


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

alice_point = 0
bob_point = 0

def pick_card(card_list):
    # print(card_list)
    max = 0
    max_index = 0
    for i in range(card_list.__len__()):
        # print('-------', i)
        if card_list[i] > max:
            # print('@', i, ':', max, '<', card_list[i])
            max = card_list[i]
            max_index = i
    
    del card_list[max_index]

    # print('----', card_list)

    return max, card_list

turn = 0
while turn < n:
    # print('--', turn)
    remain_list = []
    if turn % 2 == 0:
        alice_get, remain_list = pick_card(card_list)
        alice_point += alice_get
    else:
        bob_get, remain_list = pick_card(card_list)
        bob_point += bob_get

    card_list = remain_list
    # print(alice_point, bob_point, card_list)

    turn += 1

print(alice_point - bob_point)
from math import sqrt
from collections import Counter

def factorize(n):
    rt = int(sqrt(n)+1)
    facts = []
    for i in range(2, rt+1):
        if n % i == 0:
            facts.append(i)
            while n % i == 0:
                n //= i
    if n != 1:
        facts.append(n)
    return facts

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

P = Counter()
6 
for a in A:
    p = Counter(factorize(a))
    P += p
p_max = max(P.values())
if  p_max == 1:
    print('pairwise coprime')
elif  p_max <  n:
    print('setwise coprime')
else:
    print('not coprime')

### FIXED CODE ###

def arrayF(n): 
    F=[0]*(n+1) 
    i=2 
    while i*i<=n:
        if F[i] == 0: 
            k=i*i
            while k <= n:
                if F[k] == 0:
                    F[k] = i
                k += i
        i += 1 
    return F


def factorization(x, F): 
    primeFactors = []
    while F[x] > 0:
        primeFactors.append(F[x])
        x //= F[x] 
    if x != 1:
        primeFactors.append(x)
    return set(primeFactors)

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

amax = max(A)
F  = arrayF(amax)

P = [0] *  (amax+1)
for a in A:
    for p in factorization(a,  F):
        P[p] += 1
p_max = max(P)
if  p_max <= 1:
    print('pairwise coprime')
elif  p_max <  n:
    print('setwise coprime')
else:
    print('not coprime')