Harryxun/sft_time huggingface dataset:
### BUGGY CODE ###

N, M = map(int, input().split())
X, Y, Z = [0] * M, [0] * M, [0] * M
for i in range(M):
	X[i], Y[i], Z[i] = map(int, input().split())
Groups = [[X[0], Y[0]]]
for i in range(1, M):
	flag = False
	for g in Groups:
		if X[i] in g:
			g.append(Y[i])
			flag = True
		elif Y[i] in g:
			g.append(X[i])
			flag = True
	if flag == False:
		Groups.append([X[i], Y[i]])
cnt = 0
for j in range(1, N + 1):
	flag = False
	for g in Groups:
		if j in g:
			flag = True
	if flag == False:
		cnt += 1
print(len(Groups) + cnt)


### FIXED CODE ###

class UnionFind:
	def __init__(self, n):
		self.par = [i for i in range(n)]  # 親
		self.rank = [1] * n  # 深さ
		self.size = [1] * n  # size[i]はiを根とするグループのサイズ

	def find(self, x):  # xの親を返す
		if self.par[x] == x:
			return x
		else:
			return self.find(self.par[x])

	def unite(self, x, y):  # x,yの属する集合をマージする
		x = self.find(x)
		y = self.find(y)
		if x != y:
			if self.rank[x] < self.rank[y]:
				self.par[x] = y
				self.size[y] += self.size[x]
			else:
				self.par[y] = x
				self.size[x] += self.size[y]
				if self.rank[x] == self.rank[y]:
					self.rank[x] += 1

N, M = map(int, input().split())
X, Y, Z = [0] * M, [0] * M, [0] * M
for i in range(M):
	X[i], Y[i], Z[i] = map(int, input().split())

uf = UnionFind(N)

for j in range(M):
	uf.unite(X[j] - 1, Y[j] - 1)

roots = set([])
for k in range(N):
	roots.add(uf.find(k))
print(len(roots))
### BUGGY CODE ###

def main():
    n,m = map(int,input().split())
    alb = {}
    for i in range(n):
        a,b = map(int,input().split())
        if a not in alb.keys():
            alb[a] = [b]
        else:
            alb[a] += [b]
    search = []
    s = 0
    for i in range(1,m+1):
        if i in alb.keys():
            for j in range(len(alb[i])):
                search.append(alb[i][j])
        if len(search)>0:
            m = search.pop(search.index(max(search)))
            s += m
    print(s)

if __name__ == "__main__":
    main()

### FIXED CODE ###

def main():
    import heapq
    n,m = map(int,input().split())
    alb = {}
    for i in range(n):
        a,b = map(int,input().split())
        if a not in alb.keys():
            alb[a] = [b]
        else:
            alb[a] += [b]
    h = []
    s = 0
    for i in range(1,m+1):
        if i in alb.keys():
            for j in range(len(alb[i])):
                heapq.heappush(h, -1*alb[i][j])
        if len(h)>0:
            m = heapq.heappop(h)
            s += -1*m
    print(s)

if __name__ == "__main__":
    main()
### BUGGY CODE ###

#!/usr/bin/env python3

def main():
    N = int(input())
    A = list(map(int, input().split()))
    B = list(map(int, input().split()))
    ans = 0
    for k in range(30):
        C = [x & ((1 << (k+1)) - 1) for x in A]
        D = [x & ((1 << (k+1)) - 1) for x in B]
        C.sort()
        D.sort()
        # print(f'k = {k}')
        # print(f'C = {C}')
        # print(f'D = {D}')
        p, q, r = 0, 0, 0
        for i in range(N-1, -1, -1):
            while p < N:
                if C[i] + D[p] >= 1 << k: break
                p += 1
            while q < N:
                if C[i] + D[q] >= 2 << k: break
                q += 1
            while r < N:
                if C[i] + D[r] >= 3 << k: break
                r += 1
            x = ((q - p) + (N - r)) % 2
            # print(p, q, r, x)
            ans = ans ^ (x << k)
    print(ans)

main()


### FIXED CODE ###

#!/usr/bin/env python3

def main():
    N = int(input())
    A = list(map(int, input().split()))
    B = list(map(int, input().split()))
    ans = 0
    for k in range(30):
        C = [x & ((1 << (k+1)) - 1) for x in A]
        D = [x & ((1 << (k+1)) - 1) for x in B]
        C.sort()
        D.sort()
        # print(f'k = {k}')
        # print(f'C = {C}')
        # print(f'D = {D}')
        p, q, r = 0, 0, 0
        for i in range(N-1, -1, -1):
            while p < N:
                if C[i] + D[p] >= 1 << k: break
                p += 1
            while q < N:
                if C[i] + D[q] >= 2 << k: break
                q += 1
            while r < N:
                if C[i] + D[r] >= 3 << k: break
                r += 1
            x = ((q - p) + (N - r)) % 2
            # print(p, q, r, x)
            ans = ans ^ (x << k)
    print(ans)

main()
### BUGGY CODE ###

n = int(input())
List = list(map(int,input().split()))
max = 0
rest = n
for i in range(n-1):
    counter = 0
    for j in range(n-i-1):
        if List[i+j] >= List[i+j+1]:
            counter +=1
            if counter > max:
                max = counter
            
            if rest < max:
                break
        else:
            break
        
print(max)



### FIXED CODE ###

N = int(input())
H = list(map(int,input().split()))
counter = 0
Ans = 0
temp = 0
for i in range(N-1):
  if H[counter]>=H[counter+1]:
    temp += 1
    if temp > Ans:
      Ans = temp
    counter += 1
  else:
    temp = 0
    counter += 1
    
print(Ans)
### BUGGY CODE ###

from collections import defaultdict
from collections import deque
from collections import Counter
import math

def readInt():
	return int(input())
def readInts():
	return list(map(int, input().split()))
def readChar():
	return input()
def readChars():
	return input().split()

class UnionFind():
    def __init__(self, n):
        self.n = n
        self.parents = [-1] * n

    def find(self, x):
        if self.parents[x] < 0:
            return x
        else:
            self.parents[x] = self.find(self.parents[x])
            return self.parents[x]

    def union(self, x, y):
        x = self.find(x)
        y = self.find(y)

        if x == y:
            return

        if self.parents[x] > self.parents[y]:
            x, y = y, x

        self.parents[x] += self.parents[y]
        self.parents[y] = x

    def size(self, x):
        return -self.parents[self.find(x)]

    def same(self, x, y):
        return self.find(x) == self.find(y)

    def members(self, x):
        root = self.find(x)
        return [i for i in range(self.n) if self.find(i) == root]

    def roots(self):
        return [i for i, x in enumerate(self.parents) if x < 0]

    def group_count(self):
        return len(self.roots())

    def all_group_members(self):
        return {r: self.members(r) for r in self.roots()}

    def __str__(self):
        return '\n'.join('{}: {}'.format(r, self.members(r)) for r in self.roots())

    def depth(self):
    	ans = 0
    	for r in self.roots():
    		ans = max(ans, len(self.members(r)))
    	return ans

n,m = readInts()
ab = []
for i in range(m):
	ab.append(tuple(sorted(readInts())))
ab = sorted(list(set(ab)),key=lambda x:x[0])


uf = UnionFind(n+1)
for a,b in ab:
	uf.union(a,b)

print(uf.depth())

### FIXED CODE ###

from collections import defaultdict
from collections import deque
from collections import Counter
import math

def readInt():
	return int(input())
def readInts():
	return list(map(int, input().split()))
def readChar():
	return input()
def readChars():
	return input().split()

class UnionFind():
    def __init__(self, n):
        self.n = n
        self.parents = [-1] * n

    def find(self, x):
        if self.parents[x] < 0:
            return x
        else:
            self.parents[x] = self.find(self.parents[x])
            return self.parents[x]

    def union(self, x, y):
        x = self.find(x)
        y = self.find(y)

        if x == y:
            return

        if self.parents[x] > self.parents[y]:
            x, y = y, x

        self.parents[x] += self.parents[y]
        self.parents[y] = x

    def size(self, x):
        return -self.parents[self.find(x)]

    def same(self, x, y):
        return self.find(x) == self.find(y)

    def members(self, x):
        root = self.find(x)
        return [i for i in range(self.n) if self.find(i) == root]

    def roots(self):
        return [i for i, x in enumerate(self.parents) if x < 0]

    def depth(self):
    	ans = 0
    	for r in self.roots():
    		ans = max(ans,self.size(r))
    	return ans

n,m = readInts()
ab = []
for i in range(m):
	ab.append(readInts())

uf = UnionFind(n+1)
for a,b in ab:
	uf.union(a,b)

print(uf.depth())
### BUGGY CODE ###

n,m=map(int,input().split())
root=[i for i in range(n+1)]
rank=[0]*(n+1)
def find(x):
    if x==root[x]:
        return x 
    else:
        return find(root[x])

def union(x1,y1):
    x=find(x1)
    y=find(y1)
    if rank[x]>rank[y]:
        root[y]=x 
    elif rank[x]<=rank[y]:
        root[x]=y
        if rank[x]==rank[y]:
            rank[y]+=1
def k_sub():    
    p=list(map(int,input().split()))
    p=[-1]+p 
    for _ in range(m):
        x,y=map(int,input().split())
        union(x,y)
    d=[[] for i in range(n+1)]
    u=[[] for i in range(n+1)]
    for i in range(1,n+1):
        d[find(i)].append(i)
        u[find(i)].append(p[i])
    cnt=0
    for i in range(1,n+1):
        for candidate in d[i]:
            cnt+=(candidate in u[i])
    print(cnt)
if __name__=='__main__':
    k_sub()

### FIXED CODE ###

n,m=map(int,input().split())
p=list(map(int,input().split()))
uf={i:i for i in range(1,n+1)}
def get_p(i):
    lst=[]
    while uf[i]!=i:
        lst.append(i)
        i=uf[i]
    for l in lst[:-1]:
        uf[l]=i 
    return i 

def unite(i,j):
    uf[get_p(i)]=get_p(j)
def same(i,j):
    return get_p(i)==get_p(j)

def main():
    for i in range(m):
        x,y=map(int,input().split())
        unite(x,y)
    cnt=0
    for i in range(1,n+1):
        cnt+=same(p[i-1],uf[i])
    print(cnt)    
if __name__=='__main__':
    main()
### BUGGY CODE ###

import collections


def main():
    n = int(input())
    *v, = map(int, input().split())

    v0 = count(v[::2])
    v1 = count(v[1::2])

    if len(v0) == 1 and len(v1) == 1:
        if v0[0][0] == v1[0][0]:
            print(n // 2)
        else:
            print(0)
        return

    l0 = max(2, len(v0))
    l1 = max(2, len(v1))

    INF = 10 ** 9
    score = [[0] * l1 for _ in range(l0)]
    for i in range(l0):
        for j in range(l1):
            score[i][j] = sum_v(v0, i) + sum_v(v1, j)
            if i >= l0 - 1 or j >= l1 - 1 or v0[i][0] == v1[j][0]:
                score[i][j] = INF
    print(min([min(s) for s in score]))


def count(v):
    return collections.Counter(v).most_common()


def sum_v(v, ii):
    return sum([vv[1] for i, vv in enumerate(v) if i != ii])


main()


### FIXED CODE ###

def main():
    n = int(input())
    *v, = map(int, input().split())

    v0 = assemble(v[::2])
    v1 = assemble(v[1::2])

    if len(v0) == 1 and len(v1) == 1:
        if v0[0][0] == v1[0][0]:
            print(n // 2)
        else:
            print(0)
        return
    elif len(v0) == 1:
        if v0[0][0] == v1[0][0]:
            print(sum_v(v1, 1))
        else:
            print(sum_v(v1, 0))
        return
    elif len(v1) == 1:
        if v0[0][0] == v1[0][0]:
            print(sum_v(v0, 1))
        else:
            print(sum_v(v0, 0))
        return

    score = [[0, 0], [0, 0]]
    for i in range(2):
        for j in range(2):
            score[i][j] = sum_v(v0, i) + sum_v(v1, j)
            if v0[i][0] == v1[j][0]:
                score[i][j] = 10 ** 9
    print(min([min(s) for s in score]))


def assemble(v):
    dct = {}
    for vel in v:
        if vel in dct:
            dct[vel] += 1
        else:
            dct[vel] = 1
    return sorted(list(dct.items()), key=lambda x: x[1], reverse=True)


def sum_v(v, ii):
    return sum([vv[1] for i, vv in enumerate(v) if i != ii])


main()
### BUGGY CODE ###

N, M = map(int, input().split())
H = list(map(int, input().split()))
grid = []
for i in range(M):
    array = list(map(int, input().strip().split()))
    grid.append(array)

flag = 0
X = 0

for a in range(1, N+1):
    for b in grid:
        if b[0] == a:
            if H[b[1]-1] >= H[a-1]:
                break
        elif b[1] == a:
            if H[b[0]-1] >= H[a-1]:
                break
    else:
        X += 1

print(X)

### FIXED CODE ###

N, M = map(int, input().split())
H = list(map(int, input().split()))
grid = []
for i in range(M):
    array = list(map(int, input().strip().split()))
    grid.append(array)

flag = 0
X = 0

S = [1] * N


# for a in range(1, N+1):
#     for b in grid:
#         if b[0] == a:
#             if H[b[1]-1] >= H[a-1]:
#                 break
#         elif b[1] == a:
#             if H[b[0]-1] >= H[a-1]:
#                 break
#     else:
#         X += 1

for b in grid:
    if H[b[0]-1] > H[b[1]-1]:
        S[b[1]-1] = 0
    elif H[b[0]-1] < H[b[1]-1]:
        S[b[0]-1] = 0
    elif H[b[0]-1] == H[b[1]-1]:
        S[b[0] - 1] = 0
        S[b[1] - 1] = 0

X = sum(S)

print(X)
### BUGGY CODE ###

n,q=map(int,input().split())
s=input()
for i in range(q):
  a,b=map(int,input().split())
  t=s[a-1:b]
  print(t.count('AC'))

### FIXED CODE ###

import itertools

n,q=map(int,input().split())
s=input()
lst=[0]*(n-1)

for i in range(n-1):
  if s[i:i+2]=='AC':
    lst[i]+=1
    
lst=list(itertools.accumulate(lst))
lst=[0]+lst

for i in range(q):
  s,t=map(int,input().split())
  print(lst[t-1]-lst[s-1])
### BUGGY CODE ###

from collections import deque
N,K=map(int,input().split())
s=input()
ans=0
l1=deque([])
l2=deque([])
for i in range(N-1):
  if s[i:i+2]=='LR':
    l1.append(i)
  elif s[i:i+2]=='RL':
    l2.append(i)
  elif s[i]=='L' and s[i+1]=='L':
    ans+=1
  elif s[i]=='R' and s[i+1]=='R':
    ans+=1

while K>0 and len(s)-2>ans:
  if l1[0]<l2[-1]:
    n1=l1.popleft()
    n2=l2.pop()
    l1=deque([(n1+n2-n) for n in l1 if n<n2])
    l2=deque([(n1+n2-n) for n in l2])
    ans+=2
    K-=1
if len(s)-2<=ans and K>=1:
  ans=len(s)-1
print(ans)

### FIXED CODE ###

N,K=map(int,input().split())
s=input()
ans=0
l1=[]
l2=[]
for i in range(N-1):
  if s[i:i+2]=='LR':
    l1.append(i)
  elif s[i:i+2]=='RL':
    l2.append(i)
  elif s[i]=='L' and s[i+1]=='L':
    ans+=1
  elif s[i]=='R' and s[i+1]=='R':
    ans+=1

while K>0 and len(s)-2>ans:
  ans+=2
  K-=1
if len(s)-2<=ans and K>=1:
  ans=len(s)-1
print(ans)
### BUGGY CODE ###

from functools import reduce

S = input()

# 末尾から各あまりについてDP
M = 13
MOD = 10**9 + 7
ans = reduce(
    lambda acc, c: (
        [
            sum(
                acc[0][(i - acc[1] * j) % M]
                for j in range(10)
            ) % MOD
            for i in range(M)
        ] if c == '?' else
        [
            acc[0][(i - acc[1] * int(c)) % M]
            for i in range(M)
        ],
        (10 * acc[1]) % M
    ),
    S[::-1],
    (
        [
            1 if i == 0 else
            0
            for i in range(M)
        ],
        1
    )
)[0][5]

print(ans)


### FIXED CODE ###

from functools import reduce

S = input()

# 末尾から各あまりについてDP
M = 13
MOD = 10**9 + 7
ans = reduce(
    lambda acc, c: (
        [
            sum(
                acc[0][(i - acc[1] * j) % M]
                for j in range(10)
            ) % MOD
            for i in range(M)
        ] if c == '?' else
        [
            acc[0][(i - acc[1] * int(c)) % M]
            for i in range(M)
        ],
        (10 * acc[1]) % M
    ),
    S[::-1],
    (
        [
            1 if i == 0 else
            0
            for i in range(M)
        ],
        1
    )
)[0][5]

print(ans)
### BUGGY CODE ###


n = int(input())
a = []
for i in range(n):
    a.append(int(input()))

b = []

for i in range(n):
    tmp = a[i]
    del a[i]
    b.append(max(a))
    a.insert(i,tmp)

for i in range(len(b)):
    print(b[i])


### FIXED CODE ###


n = int(input())
a = [int(input()) for _ in range(n)]
b = a.copy()
b.sort()

for i in range(n):
    if a[i] == b[-1]:
        print(b[-2])
    else:
        print(b[-1])
### BUGGY CODE ###

import sys
import math
from collections import deque
from collections import defaultdict

def main():
    n, k = list(map(int,sys.stdin.readline().split()))
    p = list(map(int,sys.stdin.readline().split()))
    sum_max = 0
    max_idx = 0
    for i in range(n - k + 1):
        max_tmp = 0
        for j in range(k):
            max_tmp += p[i+j]
        if sum_max < max_tmp:
            max_idx = i
            sum_max = max_tmp
    #print(max_idx)
    ans = 0
    for i in range(max_idx, max_idx + k):
        ans += ((p[i] * (p[i] + 1)) / 2) / p[i]
    print("{:.12f}".format(ans))
    return 0

if __name__ == "__main__":
    main()

### FIXED CODE ###

import sys
import math
from collections import deque
from collections import defaultdict

def main():
    n, k = list(map(int,sys.stdin.readline().split()))
    p = list(map(int,sys.stdin.readline().split()))
    sum_l = [0] * (n - k + 1)
    for i in range(k):
        sum_l[0] += p[i]
    for i in range(1,n - k + 1):
        sum_l[i] = sum_l[i - 1] - p[i - 1] + p[i + k - 1]
    #print(sum_l)
    max_idx = sum_l.index(max(sum_l))
    #print(max_idx)
    ans = 0
    for i in range(max_idx, max_idx + k):
        ans += ((p[i] * (p[i] + 1)) / 2) / p[i]
    print("{:.12f}".format(ans))
    return 0
    
if __name__ == "__main__":
    main()
### BUGGY CODE ###

from functools import reduce
from fractions import gcd


def gcd4args(args):
    return reduce(gcd, args)


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

ans = 0
for i in range(N):
    # lstTmp = lstA[0:i] + lstA[i+1:]
    tmp = lstA[i]
    if i < N-1:
        lstA[i] = lstA[i+1]
        # print(lstA)
        ans = max(ans, gcd4args(lstA))
    else:
        lstA[i] = lstA[i-1]
        # print(lstA)
        ans = max(ans, gcd4args(lstA))
    lstA[i] = tmp
    # print(lstA)
print(ans)

### FIXED CODE ###

from fractions import gcd


N = int(input())
lstA = list(map(int, input().split()))
lstL = [0] * N
lstR = [0] * N


for i in range(1, N):
    lstL[i] = gcd(lstL[i-1], lstA[i-1])
for i in range(N-1)[::-1]:
    lstR[i] = gcd(lstR[i+1], lstA[i+1])
lstGcd = [gcd(lstL[i], lstR[i]) for i in range(N)]
ans = max(lstGcd)


print(ans)
### BUGGY CODE ###

#部分点とは？
s = input()
k = int(input())
can = []
for l in range(len(s)):
  for w in range(len(s)):
    try:
      now = s[l:l+w+1]
      if now in can:
        pass
      else:
        can.append(now)
    except:
      pass
can.sort()
print(can[k-1])

### FIXED CODE ###

#解説解答
s = input()
k = int(input())
can = []
for l in range(len(s)):
  for w in range(5):
    try:
      now = s[l:l+w+1]
      if now in can:
        pass
      else:
        can.append(now)
    except:
      pass
can.sort()
print(can[k-1])
### BUGGY CODE ###

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

event_list=[]
for i in range(N):
  S,T,X=map(int,input().split())
  event_list.append((S-X-0.5,1,X))
  event_list.append((T-X-0.5,-1,X))
  
dlist=[]
for i in range(Q):
  D=int(input())
  event_list.append((D,0,X))  
  dlist.append(D)
event_list.sort()
#print(event_list)

answer_dic={}
stop_set=set()
for t,f,x in event_list:
  if f==1:
    stop_set.add(x)
  elif f==-1:
    stop_set.remove(x)
  else:
    if len(stop_set)>0:
      answer_dic[t]=min(stop_set)
#print(answer_dic)

for d in dlist:
  if d in answer_dic:
    print(answer_dic[d])
  else:
    print(-1)

### FIXED CODE ###

import heapq
import sys
input=sys.stdin.readline
N,Q=map(int,input().split())

event_list=[]
for i in range(N):
  S,T,X=map(int,input().split())
  event_list.append((S-X-0.5,1,X))
  event_list.append((T-X-0.5,-1,X))
  
dlist=[]
for i in range(Q):
  D=int(input())
  event_list.append((D,0,X))  
  dlist.append(D)
event_list.sort()
#print(event_list)

answer_dic={}
stop_set=set()
min_set=float("inf")
for t,f,x in event_list:
  if f==1:
    stop_set.add(x)
    if x<min_set:
      min_set=x
  elif f==-1:
    stop_set.remove(x)
    if x==min_set:
      if len(stop_set)>0:
        min_set=min(stop_set)
      else:
        min_set=float("inf")
  else:
    if len(stop_set)>0:
      answer_dic[t]=min_set
    else:
      answer_dic[t]=-1
#print(answer_dic)

for d in dlist:
  print(answer_dic[d])
### BUGGY CODE ###

x, y, z, k = map(int, input().split())
A = sorted(list(map(int, input().split())), reverse=True)
B = sorted(list(map(int, input().split())), reverse=True)
C = sorted(list(map(int, input().split())), reverse=True)

ABC = []
for i in range(x):
    for j in range(y):
        if (i + 1) * (j + 1)  <= k:
            for h in range(z):
                if (i + 1) * (j + 1) * (h + 1) <= k:
                    ABC.append(A[i] + B[j] + C[h])

ABC.sort(reverse=True)

for i in range(k):
    print(ABC[i])


### FIXED CODE ###

x, y, z, k = map(int, input().split())
A = sorted(list(map(int, input().split())), reverse=True)
B = sorted(list(map(int, input().split())), reverse=True)
C = sorted(list(map(int, input().split())), reverse=True)

AB = []
for a in A:
    for b in B:
        AB.append(a + b)

AB.sort(reverse=True)

ABC = []
for i in range(min(x * y, k)):
    for c in C:
        ABC.append(AB[i] + c)

ABC.sort(reverse=True)

for i in range(k):
    print(ABC[i])
### BUGGY CODE ###

def main():
    from math import gcd

    def soinsuu(a):
        yy, j = set(), 2
        y = yy.add
        while(a > 1):
            for i in range(j, int(a**0.5)+1):
                if a % i == 0:
                    y(i)
                    a, j = a//i, i
                    break
            else:
                y(a)
                break
        return yy
    n = int(input())
    a = list(map(int, input().split()))

    s = set()
    flag = False
    for i in a:
        so = soinsuu(i)
        for j in so:
            if j in s:
                flag = True
                break
            else:
                s.add(j)
        if flag:
            break
    if flag == False:
        print("pairwise coprime")
        return

    temp1 = a[0]
    for i in a[1:]:
        temp1 = gcd(temp1, i)
    if temp1 > 1:
        print("not coprime")
    else:
        print("setwise coprime")


main()


### FIXED CODE ###

def main():
    from math import gcd

    def soinsuu(a):
        yy, j = set(), 2
        y = yy.add
        while(a > 1):
            for i in range(j, int(a**0.5)+1):
                if a % i == 0:
                    y(i)
                    a, j = a//i, i
                    break
            else:
                y(a)
                break
        return yy
    n = int(input())
    a = list(map(int, input().split()))

    s = set()
    flag = False
    for i in a:
        so = soinsuu(i)
        for j in so:
            if j in s:
                flag = True
                break
            else:
                s.add(j)
        if flag:
            break
    if flag == False:
        print("pairwise coprime")
        return

    temp1 = a[0]
    for i in a[1:]:
        temp1 = gcd(temp1, i)
    if temp1 > 1:
        print("not coprime")
    else:
        print("setwise coprime")


main()
### BUGGY CODE ###

n, k, q = map(int, input().split())
a = []
for _ in range(q):
  a.append(int(input()))
for i in range(1, n+1):
  s = 'Yes' if k-q+a.count(i)>0 else 'No'
  print(s)

### FIXED CODE ###

n, k, q = map(int, input().split())
a = [0]*n
for _ in range(q):
  a[int(input())-1] += 1
for i in range(n):
  s = 'Yes' if k-q+a[i]>0 else 'No'
  print(s)
### BUGGY CODE ###

import math
n=int(input())
a=list(map(int,input().split()))
s=[0 for _ in range(30)]
for i in range(n):
  for j in range(30):
    s[j]=(s[j]+((a[i]&pow(2,j))//pow(2,j)))
for i in range(n):
  ans=0
  for j in range(30):
    ans=ans+pow(2,j)*(((a[i]&pow(2,j))//pow(2,j)+s[j]+n)%2)
  print(ans)

### FIXED CODE ###

n=int(input())
a=list(map(int,input().split()))
p=[]
for j in range(30):
  p.append(pow(2,j))
t=0
for i in range(n):
  t=t^a[i]
for i in range(n):
  ans=0
  for j in range(30):
    ans=ans+p[j]*(((a[i]^t)//p[j])%2)
  print(ans,end=" ")
### BUGGY CODE ###

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

for i in range(n):
    q = p[0:i+1]
    if not p[i] <= min(q):
        m -= 1

print(m)

### FIXED CODE ###

n = int(input())
p = list(map(int,input().split()))
m = n
q = 2 * (10 ** 5)

for i in range(n):
    q = min(p[i],q)
    if not p[i] <= q:
        m -= 1

print(m)