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

import sys
sys.setrecursionlimit(10000)

n, m = map(int, input().split())
abc = [tuple(int(x) - 1 for x in input().split()) for _ in range(m)]

dist = [[9999999 for _ in range(n)] for _ in range(n)]

e = [dict() for _ in range(n)]

for i in range(m):
    a, b, c = abc[i][0], abc[i][1], abc[i][2]
    e[a][b] = c + 1
    e[b][a] = c + 1

for i in range(n-1):
    for j in range(i + 1, n):
        dp = [9999999 for _ in range(n)]
        dp[i] = 0
        temp = set()
        temp.add(i)
        while j not in temp:
            next = -1
            nc = 99999999
            for x in temp:
                for y in e[x].keys():
                    if y in temp:
                        continue
                    if dp[x] + e[x][y] < nc:
                        nc = dp[x] + e[x][y]
                        next = y
            temp.add(next)
            dp[next] = nc
            #print(temp, dp)
        dist[i][j] = dp[j]
        dist[j][i] = dp[j]

for i in range(n):
    dist[i][i] = 0

ans = m
for a, b, c in abc:
    for i in range(n):
        if c + 1 == dist[a][i] - dist[b][i]:
            ans -= 1
            break
print(ans)

### FIXED CODE ###

import heapq

n, m = map(int, input().split())
abc = [tuple(int(x) - 1 for x in input().split()) for _ in range(m)]

dist = [[9999999 for _ in range(n)] for _ in range(n)]

e = [dict() for _ in range(n)]

for i in range(m):
    a, b, c = abc[i][0], abc[i][1], abc[i][2]
    e[a][b] = c + 1
    e[b][a] = c + 1

for i in range(n):
    h = []
    heapq.heappush(h, [0, i])
    temp = set()
    #temp.add(i)
    while len(temp) < n:
        d, p = heapq.heappop(h)
        while p in temp:
            d, p = heapq.heappop(h)
        dist[i][p] = d
        temp.add(p)
        for x in e[p].keys():
            heapq.heappush(h, [d + e[p][x], x])

#for i in range(n): print(dist[i])

ans = m
for a, b, c in abc:
    for i in range(n):
        if c + 1 == dist[a][i] - dist[b][i]:
            ans -= 1
            break
print(ans)
### BUGGY CODE ###

from bisect import bisect_left as bl
from bisect import bisect_right as br
n=int(input())
s=sorted(list(map(int,input().split())))
q=0
d=[[""]*(1001)for i in range(1001)]
for i in range(n):
    for j in range(i+1,n):
        x,y=max(s[i],s[j]),min(s[i],s[j])
        if d[x][y]=="":
            c=br(s,x+y-1)-bl(s,x-y+1)-1
            if x-y<y:
                c-=1
            c=max(c,0)
            d[x][y]=c
        q+=c
print(q//3)

### FIXED CODE ###

from bisect import bisect_left as bl
from bisect import bisect_right as br
n=int(input())
s=sorted(list(map(int,input().split())))
q=0
d=[[""]*(1001)for i in range(1001)]
for i in range(n):
    for j in range(i+1,n):
        x,y=max(s[i],s[j]),min(s[i],s[j])
        if d[x][y]=="":
            c=br(s,x+y-1)-bl(s,x-y+1)-1
            if x-y<y:
                c-=1
            c=max(c,0)
            d[x][y]=c
        q+=d[x][y]
print(q//3)
### BUGGY CODE ###

N,X,M = map(int,input().split())
count = 1
S = X
A = [X]

for i in range(2,N+1):
  A_i = (A[-1]*A[-1])%M
  A.append(A_i)
  S += A_i
  if len(A) != len(set(A)):
    S -= A_i
    del A[-1]
    B = A[A.index(A_i):]
    S += ((N-len(A))//len(B))*sum(B) + sum(B[:((N-len(A))%len(B))])
    break

print(S)

### FIXED CODE ###

N,X,M = map(int,input().split())
S = X
A = [X]
exists = [0]*M
exists[X] = 1

for i in range(2,N+1):
  A_i = (A[-1]*A[-1])%M
  A.append(A_i)
  S += A_i
  if exists[A_i] == 0:
    exists[A_i] = 1
  else:
    S -= A_i
    del A[-1]
    B = A[A.index(A_i):]
    S += ((N-len(A))//len(B))*sum(B) + sum(B[:((N-len(A))%len(B))])
    break

print(S)
### BUGGY CODE ###

import collections

n = int(input())
s = [input() for i in range(n)]
t = collections.Counter(s)
d = 0
i = 0
x = []
y = []
for i in range(len(t.most_common())):
    y.append(t.most_common()[i][1])
c = y.count(y[0])
for i in range(c):
    x.append(t.most_common()[i][0])
x.sort()
for i in range(len(x)):
    print(x[i])


### FIXED CODE ###

import collections

n = int(input())
s = [input() for i in range(n)]
t = collections.Counter(s)
tm = t.most_common()
x = [tm[i][0] for i in range(len(tm)) if tm[i][1]==tm[0][1]]
x.sort()
for i in range(len(x)):
    print(x[i])
### BUGGY CODE ###

import numpy as np

###################################
def arrmax(list):
    array = np.array(list)
#    print(np.argmax(array, axis=1)) ##座標
#    print(np.amax(array,axis=None)) ##値
    return np.amax(array,axis=None)
#################################
##ワーシャルフロイド法
#################################
def warshall_floyd(d,n):
    #d[i][j]: iからjへの最短距離
    for k in range(n):
        for i in range(n):
            for j in range(n):
                d[i][j] = min(d[i][j],d[i][k] + d[k][j])
    return d
##############################
##２部グラフか判別
##############################
def judge(n,v,c):
    def f(v, c):
        # 頂点vに隣接する頂点全てを塗るあるいは判定する
        color[v] = c
        for i in range(len(g[v])):
            if color[g[v][i]] == c:
                return False
            elif color[g[v][i]] == 0 and not f(g[v][i], -c):
                # (g[v][i]がまだ塗られていない　かつ　そこを-cで塗っても問題ない) ではないなら
                return False
        return True

    color = [0] * n  # color[i]:点iの色(1 or -1)。但し塗られていないときは0とする
    k = 1  # 判定　1ならYes -1ならNo
    for i in range(n):
        if color[i] == 0:
            if not f(i, c):
                k = -1

    if k == 1:
        return True
    else:
        return False

#######################################
N = int(input())
S = [[0 for j in range(N)] for i in range(N)]
d = [[float("inf") for i in range(N)] for i in range(N)]
g = [[] for i in range(N)] #g[i]:点iに隣接している点のリスト
for i in range(N):
    S[i] = str(input())
    for j in range(N):
        if S[i][j]=="1":
            d[i][j]=1
            d[j][i]=1
            g[i].append(j)
            g[j].append(i)


for i in range(N):
    d[i][i] = 0 #自身のところに行くコストは０

if judge(N,d,1):
    print(arrmax(warshall_floyd(d,N))+1) ##直径出力+1
else:
    print("-1")


### FIXED CODE ###

from collections import deque

def bfs(n,e,fordfs):
    W = [-1]*n
    W[e] = 0
    que = deque()
    que.append(e)
    len = [0]*n
    while que:
        now = que.popleft()
        nowv = W[now]
        nowlen = len[now]
        for ne in fordfs[now]:
            if nowv == W[ne]:
                return -1
#                print(-1)
#                exit()
            elif W[ne] == -1:
                W[ne] = (nowv+1) % 2
                len[ne] = nowlen+1
                que.append(ne)
    return max(len)

N = int(input())
data = [list(map(int, list(input()))) for i in range(N)]
v = [[] for i in range(N)]
maxlen = [0]*N

for i in range(N):
    for j in range(N):
        if data[i][j] == 1:
            v[i].append(j)
for i in range(N):
    maxlen[i] = bfs(N,i,v)


ans = max(maxlen)+1
if ans==0:
    ans = -1

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

N, K = map(int,input().split())
while True:
    if N%K == 0:
        print(0)
        break
    if abs(N-K) < N:
        N = abs(N-K)
    else:
        print(N)
        break

### FIXED CODE ###

N, K = map(int,input().split())
while True:
    if N%K == 0:
        print(0)
        break
    else:
        N=N%K
        N = min(N,abs(N-K))
        print(N)
        break
### BUGGY CODE ###

def f(D, S, T, W):
    close = [set(), set(), set()]
    Q = []
    index = 0
    end = 1
    Q.append((S, 0, 0))

    while end > index:
        p, c, l = Q[index]
        index += 1
        if l == 0 and p == T:
            return c
        close[l].add(p)

        ns = D.setdefault(p, set())
        l, c = (l + 1) % 3, c + (l + 1) // 3
        for n in ns:
            if n in close[l]:
                continue
            Q.append((n, c, l))
            end += 1
    return -1

if __name__ == "__main__":
    N, M = list(map(int, input().split()))
    D = {}
    for m in range(M):
        u, v = map(int, input().split())
        u -= 1
        v -= 1
        D.setdefault(u, set()).add(v)

    S, T = list(map(int, input().split()))
    S -= 1
    T -= 1

    print(f(D, S, T, N * M * 10))


### FIXED CODE ###

import sys
input = sys.stdin.readline
N, M = list(map(int, input().split()))

def f(D, S, T):
    close = [[False] * N, [False] * N, [False] * N]
    Q = []
    index = 0
    Q.append((S, 0, 0))

    while len(Q) > index:
        p, c, l = Q[index]
        index += 1
        
        if close[l][p]:
            continue
        
        if l == 0 and p == T:
            return c // 3
        close[l][p] = True

        l, c = (l + 1) % 3, c + 1
        for n in D[p]:
            if close[l][n]:
                continue
            Q.append((n, c, l))
    return -1

if __name__ == "__main__":
    D = {n: set() for n in range(N)}
    for m in range(M):
        u, v = map(int, input().split())
        u -= 1
        v -= 1
        D[u].add(v)

    S, T = list(map(int, input().split()))
    S -= 1
    T -= 1

    print(f(D, S, T))
### BUGGY CODE ###

n, x, y = map(int, input().split())
edge = [[] for _ in range(n+1)]
dist = [[abs(i-j) for i in range(n+1)] for j in range(n+1)]
counter = [0 for i in range(n)]
for i in range(1, n):
    edge[i].append(i+1)
    edge[i+1].append(i)
edge[x].append(y)
edge[y].append(x)
for i in range(y+1):
    for j in range(x, n+1):
        new_dist = abs(x-i)+abs(y-j)+1
        if new_dist < dist[i][j]:
            dist[i][j] = new_dist
            dist[j][i] = new_dist

for i in range(1, n+1):
    for num in dist[i][1:]:
        counter[num] += 1
# print(dist)

for num in counter[1:]:
    print(num//2)


### FIXED CODE ###

n, x, y = map(int, input().split())
edge = [[] for _ in range(n+1)]
dist = [[abs(i-j) for i in range(n+1)] for j in range(n+1)]
counter = [0 for i in range(n)]
for i in range(1, n):
    edge[i].append(i+1)
    edge[i+1].append(i)
edge[x].append(y)
edge[y].append(x)
for i in range(y+1):
    for j in range(x, n+1):
        if j > i:
            new_dist = abs(x-i)+abs(y-j)+1
            if new_dist < dist[i][j]:
                dist[i][j] = new_dist

for i in range(1, n+1):
    for num in dist[i][i+1:]:
        counter[num] += 1
# print(dist)

for num in counter[1:]:
    print(num)
### BUGGY CODE ###

from math import ceil
from collections import deque


def start_pos():
    for r in range(H):
        for c in range(W):
            if a[r][c] == 'S':
                return r, c
    return -1, -1


def shortest_len(y, x):
    return min(y, H - 1 - y, x, W - 1 - x)


H, W, K = map(int, input().split())
a = [input() for _ in range(H)]
b = [[False for _ in range(W)] for _ in range(H)]
sy, sx = start_pos()
need_len = shortest_len(sy, sx)

q = deque()
q.append((sy, sx, 0))
while len(q) > 0:
    y, x, k = q.popleft()
    if not (0 <= y < H and 0 <= x < W): continue
    if a[y][x] == '#': continue
    if b[y][x]: continue
    b[y][x] = True
    need_len = min(need_len, shortest_len(y, x))
    if k == K: continue
    for dy, dx in (-1, 0), (1, 0), (0, -1), (0, 1):
        q.append((y + dy, x + dx, k + 1))

print(1 + ceil(need_len / K))


### FIXED CODE ###

# https://beta.atcoder.jp/contests/agc014/submissions/1268295
from collections import deque

dr = (0, 1, 0, -1)
dc = (1, 0, -1, 0)


def solve():
    H, W, K = map(int, input().split())
    a = [[False for _ in range(W)] for _ in range(H)]

    sy, sx = -1, -1
    for r in range(H):
        s = input()
        for c, x in enumerate(s):
            if x == '.':
                a[r][c] = True
            elif x == 'S':
                a[r][c] = True
                sy, sx = r, c

    visited = [[False for _ in range(W)] for _ in range(H)]
    visited[sy][sx] = True

    t = max(H, W)
    q = deque([(sy, sx, 0)])
    while q:
        r, c, k = q.popleft()

        t = min(t, r, H - 1 - r, c, W - 1 - c)
        # print(t)
        if t == 0:
            print(1)
            return

        for d_i in range(4):
            nr, nc = r + dr[d_i], c + dc[d_i]
            if 0 <= nr < H and 0 <= nc < W and a[nr][nc] and not visited[nr][nc] and k + 1 <= K:
                visited[nr][nc] = True
                q.append((nr, nc, k + 1))

    ans = 1 + (t + K - 1) // K

    print(ans)


if __name__ == '__main__':
    solve()
### BUGGY CODE ###

import numpy as np

n, w = map(int ,input().split())
items = []
for i in range(n):
    array = list(map(int, input().split()))
    items.append(array)
dp = np.zeros((n+1, w+1))


for i in range(1, n+1):
    weight = items[i-1][0]
    for j in range(0, w+1):
        if j >= weight:
            dp[i][j] = max((dp[i - 1][j - weight] + items[i - 1][1]), dp[i - 1][j])
        else:
            dp[i][j] = dp[i-1][j]

print(int(dp[-1][-1]))

### FIXED CODE ###

n, w = map(int ,input().split())
items = []
for i in range(n):
    array = list(map(int, input().split()))
    items.append(array)
# dp = np.zeros((n+1, w+1))
dp = [[0 for _ in range(w+1)] for _ in range(n+1)]

for i in range(1, n+1):
    weight = items[i-1][0]
    for j in range(0, w+1):
        if j >= weight:
            dp[i][j] = max((dp[i - 1][j - weight] + items[i - 1][1]), dp[i - 1][j])
        else:
            dp[i][j] = dp[i-1][j]


print(int(dp[i][j]))
### BUGGY CODE ###

import bisect
n,k=map(int,input().split())
A=[]
for i in range(n):
  A.append(int(input())-k)
AA,BB=[0]*(n+1),[0]*(n+1)
AA[-2]=A[-1]
BB[-2]=A[-1]
for i in reversed(range(n-1)):
  AA[i]=AA[i+1]+A[i]
  BB[i]=BB[i+1]+A[i]
ans=0
BB.sort()
for i in reversed(range(1,n+1)):
  BB.remove(AA[i])
  ans+=i-bisect.bisect_left(BB,AA[i])
print(ans)




### FIXED CODE ###

n,k=map(int,input().split())
A=[]
for i in range(n):
  A.append(int(input())-k)
AA,BB=[0]*(n+1),[0]*(n+1)
AA[-2]=A[-1]
BB[-2]=A[-1]
for i in reversed(range(n-1)):
  AA[i]=AA[i+1]+A[i]
  BB[i]=BB[i+1]+A[i]
BB.sort()
cur=1
D=dict()
D[BB[0]]=cur
for i in range(1,n+1):
  if BB[i]==BB[i-1]:
    continue
  else:
    cur+=1
    D[BB[i]]=cur
AAA=[0]*(n+1)
for i in range(n+1):
  AAA[i]=D[AA[i]]

nn=18
BIT=[0]*(2**nn)
BIT.insert(0,0)
def bitsum(BIT,i):
  s=0
  while i>0:
    s+=BIT[i]
    i-=i&(-i)
  return s
def bitadd(BIT,i,x):
  while i<=2**nn:
    BIT[i]+=x
    i+=i&(-i)
  return BIT

ans=0
for i in range(n+1):
  ans+=i-bitsum(BIT,AAA[i]-1)
  bitadd(BIT,AAA[i],1)
print(ans)
### BUGGY CODE ###

N = int(input())
Sn = []
result = 0
for i in  range (N):
    s = input()
    judge = 0
    for Si in Sn:
        if Si == s:
            judge = 1
    if judge == 0:
        result += 1
    Sn.append(s)
print(result)


### FIXED CODE ###

N = int(input())
Sn = []
for i in range(N):
    s = input()
    Sn.append(s)
print(len(set(Sn)))
### BUGGY CODE ###

#abc 165
# d
a,b,n = map(int,input().split())
nmax = 0

for i in range(0,min(b,n+1)):
    ni = int(a*i/b)
    if ni > nmax:
        nmax = ni
print(nmax)

### FIXED CODE ###

#abc 165
# d
a,b,n = map(int,input().split())
nmax = 0

# for i in range(0,min(b,n+1)):
#     ni = int(a*i/b)
#     if ni > nmax:
#         nmax = ni
# print(nmax)

q = min(b-1,n)
ni = int(a*q/b)
if ni > nmax:
        nmax = ni
print(nmax)
### BUGGY CODE ###

xs,ys,xt,yt = map(int, input().split())
n = int(input())
c = [(xs,ys, 0),(xt,yt,0)]
for i in range(n):
    x,y,r = map(int, input().split())
    c.append((x,y,r))

def circle_circle(ax,ay,ar,bx,by,br):
    d =((ax-bx)**2 + (ay-by)**2)**0.5
    return max(0, d-(ar+br))

def dijkstra(V, edges, root):
    import heapq

    visited = [False] * V
    nodes = [[] for i in range(V)]
    cost = [[] for i in range(V)]

    for e in edges:
        s, t, d = e
        nodes[s].append(t)
        cost[s].append(d)

    dist = [float('inf')] * V
    dist[root] = 0

    h = [(0, root)]
    while h:
        c, v = heapq.heappop(h)
        if visited[v]:
            continue
        visited[v] = True
        for i in range(len(nodes[v])):
            t = nodes[v][i]
            nc = c + cost[v][i]
            if dist[t] > nc:
                dist[t] = nc
                heapq.heappush(h, (nc, t))
    return dist
edges = []
for i in range(n+1):
    for j in range(i+1, n+2):
        d = circle_circle(c[i][0],c[i][1],c[i][2],c[j][0],c[j][1],c[j][2])
        edges.append((i,j,d))
        edges.append((j,i,d))
dij = dijkstra(n+2, edges, 0)
print(dij[1])


### FIXED CODE ###

xs,ys,xt,yt = map(int, input().split())
n = int(input())
c = [(xs,ys, 0),(xt,yt,0)]
for i in range(n):
    x,y,r = map(int, input().split())
    c.append((x,y,r))

def circle_circle(ax,ay,ar,bx,by,br):
    d =((ax-bx)**2 + (ay-by)**2)**0.5
    return max(0, d-(ar+br))

def dijkstra(V, edges, root):
    import heapq

    visited = [False] * V
    nodes = [[] for i in range(V)]
    cost = [[] for i in range(V)]

    for e in edges:
        s, t, d = e
        nodes[s].append(t)
        cost[s].append(d)

    dist = [float('inf')] * V
    dist[root] = 0

    h = [(0, root)]
    while h:
        c, v = heapq.heappop(h)
        if visited[v]:
            continue
        visited[v] = True
        for i in range(n+1):
            t = nodes[v][i]
            nc = c + cost[v][i]
            if dist[t] > nc:
                dist[t] = nc
                heapq.heappush(h, (nc, t))
    return dist
edges = []
for i in range(n+1):
    for j in range(i+1, n+2):
        d = circle_circle(c[i][0],c[i][1],c[i][2],c[j][0],c[j][1],c[j][2])
        edges.append((i,j,d))
        edges.append((j,i,d))
dij = dijkstra(n+2, edges, 0)
print(dij[1])
### BUGGY CODE ###

n,q=map(int,input().split())
s=input()
for i in range(q):
    l,r=map(int,input().split())
    ss=s[l-1:r]
    n=len(ss)
    ans=0
    for i in range(n-1):
        if ss[i]=="A" and ss[i+1]=='C':
            ans+=1
    print(ans)

### FIXED CODE ###

n,q=map(int,input().split())
s=input()

ac_count=[]
ac=0

for i in range(n-1):
    if s[i:i+2]=='AC':
        ac+=1
    ac_count.append(ac)
    
for i in range(q):
    l,r=map(int,input().split())
    if l==1:
        print(ac_count[r-2])
    else:
        print(ac_count[r-2]-ac_count[l-2])
### BUGGY CODE ###

N = int(input())
A1 = {}
A2 = []
for i in range(N):
  s = input()
  if s not in A2:
    A1[s] = 1
    A2.append(s)
  else:
    A1[s] += 1
sai = max(A1.values())
A2.sort()
for j in A2:
  if A1[j] == sai:
    print(j)
  

  

### FIXED CODE ###

N = int(input())
A1 = {}
for i in range(N):
  s = input()
  if s in A1:
    A1[s] += 1
  else:
    A1[s] = 1
sai = max(A1.values())
for j in sorted(k for k in A1 if A1[k] == sai):
  print(j)
### BUGGY CODE ###


def read():
    return int(input())

def reads(sep=None):
    return list(map(int, input().split()))

def f(m, a):
	r = []
	for n in a[::-1]:
		if n not in r:
			r.append(n)
	for i in range(m):
		if (i+1) not in r:
			r.append(i+1)
	return r


n, m = reads()
q = read()
a = reads()

r = f(m, a)
count = [0] * (m+1)
count[0] = n

for aa in a[::-1]:
	index = r.index(aa)
	if 0 < count[index]:
		count[index] -= 1
		count[index+1] += 1

to = 0
for i in range(m):
	if 0 < count[i]:
		to = i
		break

left, right = r[:to], r[to:]
left = set(left)

flag = True
index = 0
for i in range(1, len(r)+1):
	if i in left:
		continue
	if right[index] != i:
		flag = False
		break
	if right[index] == i:
		index += 1

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



### FIXED CODE ###


def read():
    return int(input())

def reads(sep=None):
    return list(map(int, input().split()))

def f(m, a):
	sa = set(a)
	seen = set()
	r = []
	for n in a[::-1]:
		if n not in seen:
			r.append(n)
			seen.add(n)
	for i in range(m):
		if (i+1) not in sa:
			r.append(i+1)
	return r

def isSorted(a):
	for i in range(1, len(a)):
		if a[i-1] > a[i]:
			return False
	return True

n, m = reads()
q = read()
a = reads()

r = f(m, a)
count = [0] * (m+1)
count[0] = n

table = [-1] * (m+1)
for i in range(len(r)):
	table[r[i]] = i

for aa in a[::-1]:
	index = table[aa]
	if 0 < count[index]:
		count[index] -= 1
		count[index+1] += 1

to = m
for i in range(m):
	if 0 < count[i]:
		to = i
		break

if isSorted(r[to:]):
	print('Yes')
else:
	print('No')
### BUGGY CODE ###

import collections
n = int(input())
A = list(map(int, input().split()))
b = collections.Counter(A)

for a in A:
    C = b.copy()
    x = 0
    # a == A[k]
    C[a] -= 1
    for d in C.values():
        x += d*(d-1)//2
    print(x)


### FIXED CODE ###

import collections

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

s = 0
for k, i in B.items():
    s += i*(i-1) // 2
for a in A:
    print(s-(B[a]-1))
### BUGGY CODE ###

from collections import Counter


n = int(input())
A = list(map(int, input().split()))
A.sort()
undivisible = set(range(1, 10**6+1))


def update(num):
    for div in list(undivisible):
        if div % num == 0:
            undivisible.discard(div)


counter = Counter(A)
ans = 0
for a, count in counter.items():
    if count == 1 and a in undivisible:
        ans += 1
        
    update(a)

print(ans)


### FIXED CODE ###

import numpy as np
from collections import Counter


n = int(input())
A = list(map(int, input().split()))
A.sort()
is_divisible = np.zeros(10**6+1, dtype=np.int64)


def update(num):
    nums = np.arange(num, 10**6+1, num)
    is_divisible[nums] = True

counter = Counter(A)
ans = 0
for a, count in counter.items():
    if count == 1 and not is_divisible[a]:
        ans += 1
        
    update(a)

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

N = int(input())
A = list(map(int, input().split()))
Ans = "YES"
List = []

for e in A:
    if e in List:
        Ans = "NO"
        break
    else:
        List.append(e)

print(Ans)

### FIXED CODE ###

N = int(input())
A = list(map(int, input().split()))
A.sort()
Ans = "YES"
List = []
before_n = 0
for e in A:
    if e == before_n:
        Ans = "NO"
        break
    else:
        before_n=e
print(Ans)
### BUGGY CODE ###

import sys
from itertools import product

read = sys.stdin.readline


def main():
    N = int(read())
    A = [list(map(int, read().split())) for _ in range(N)]

    answer = 0
    for i, j in product(range(N), repeat=2):
        if i < j:
            continue
        edge = A[i][j]
        for k in range(N):
            if i == k or j == k:
                continue

            tmp = A[i][k] + A[k][j]
            if tmp < edge:
                print(-1)
                exit()
            elif tmp == edge:
                break
        else:
            answer += edge

    print(answer)


if __name__ == '__main__':
    main()


### FIXED CODE ###

import sys
import numpy as np

read = sys.stdin.read

N, *A = map(int, read().split())
A = np.array(A, np.int64).reshape(N, N)
'''
answer = 0
for i, j in product(range(N), repeat=2):
    if i < j:
        continue
    edge = A[i][j]
    for k in range(N):
        if i == k or j == k:
            continue

        tmp = A[i][k] + A[k][j]
        if tmp < edge:
            print(-1)
            exit()
        elif tmp == edge:
            break
    else:
        answer += edge
'''

useless = np.zeros_like(A)

for i in range(N):
    grid = A[i] + A[i, None].T
    if np.any(grid < A):
        print(-1)
        exit()
    grid[i] = np.inf
    grid[:, i] = np.inf

    useless |= (A == grid)

print(A[useless != 1].sum() // 2)
### BUGGY CODE ###

n, m = map(int, input().split())
p, s = [], []
cor, pen = 0, 0
for _ in range(m):
    li = input().split()
    p.append(int(li[0]))
    s.append(li[1])
for j in range(n):
    corFlag = False
    penCnt = 0
    for i in range(m):
        if (p[i] == j + 1):
            if corFlag:
                continue
            elif (s[i] == 'WA'):
                penCnt += 1
            else:
                cor += 1
                corFlag = True
    if corFlag:
        pen += penCnt
print(cor, pen)

### FIXED CODE ###

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

hasAC, pena, tmpP= [0] * n, [0] * n, [0] * n

for i in range(m):
    li = input().split()
    p = int(li[0]) - 1
    s = li[1]
    if hasAC[p]:
        continue
    if s == 'AC':
        hasAC[p] = 1
        pena[p] += tmpP[p]
    else:
        tmpP[p] += 1

print(sum(hasAC), sum(pena))