Harryxun/stf_run huggingface dataset:
def main():
    S =list(map(int,input().split()))
    if S[0] == S[1] and S[0] == S[2]:
        print("No")
    else :
        print("Yes")


main()
        

### FIXED CODE ###

def main():
    S =input()

    if S[0] == S[1] and S[0] == S[2]:

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


main()
a = input()
K = int(a)

for i in K:
    print('ACL', end = "")


### FIXED CODE ###

a = input()
K = int(a)

x = 'ACL'

for i in range(K):
    print(x, end = "")
s=input()
i=0
count=0

while i<range(len(s)//2):
	if s[i]!=s[-(i+1)]:
		count+=1
	i+=1

print(count)

### FIXED CODE ###

s=input()
count=0

for i in range(len(s) // 2):
	if s[i]!=s[-(i+1)]:
		count+=1
print(count)
nCr = {}
def cmb(n, r):
    if r == 0 or r == n: return 1
    if r == 1: return n
    if (n,r) in nCr: return nCr[(n,r)]
    nCr[(n,r)] = cmb(n-1,r) + cmb(n-1,r-1)
    return nCr[(n,r)]

N,A,B = map(int,input().split())
v = sorted(list(map(int,input().split())),reverse=True)

if len(set(v)) == 1:
    print(xx)

m = sum(v[:A])/A
print(m)


n = v[:A].count(min(v[:A]))
m = v.count(min(v[:A]))
print(cmb(m,n))


### FIXED CODE ###

nCr = {}
def cmb(n, r):
    if r == 0 or r == n: return 1
    if r == 1: return n
    if (n,r) in nCr: return nCr[(n,r)]
    nCr[(n,r)] = cmb(n-1,r) + cmb(n-1,r-1)
    return nCr[(n,r)]

N,A,B = map(int,input().split())
v = sorted(list(map(int,input().split())),reverse=True)

if len(set(v)) == 1:
    print(1)
    print(1125899906842623)
    exit()

m = sum(v[:A])/A
print(m)

if len(set(v[:A]))==1:
    ans = 0
    c = v.count(v[0])
    for i in range(A,B+1):
        if i <= c:
            ans += cmb(c,i)
    print(ans)
    exit()

mi = min(v[:A])
n = v[:A].count(mi)
m = v.count(mi)
print(cmb(m,n))
n=int(input())
s=input()
if n%2==1:
  print("No")
  exit()
for i in range((n//2)-1):
  if a[i]!=a[-i-1]:
    print("No")
    exit()
print("Yes")

### FIXED CODE ###

n=int(input())
s=input()
if n%2==1:
  print("No")
  exit()
for i in range(n//2):
  if s[i]!=s[n//2+i]:
    print("No")
    exit()
print("Yes")
from scipy.sparse.csgraph import dijkstra, csgraph_from_dense
import numpy as np

H, W = map(int, input().split())
S = [input() for _ in range(H)]

v_id_dict = {}
dista = np.ones((20, 20)) * np.inf

for i in range(H):
    for j in range(W):
        if S[i][j] == ".":
            v_id_dict[i, j] = len(v_id_dict)

            if (i > 0) and (S[i - 1][j] == "."):
                dista[v_id_dict[(i, j)], v_id_dict[(i - 1, j)]] = 1

            if (j > 0) and (S[i][j - 1] == "."):
                dista[v_id_dict[(i, j)], v_id_dict[(i, j - 1)]] = 1

dist_mat = dijkstra(
    csgraph_from_dense(dista[: len(v_id_dict), : len(v_id_dict)]),
    directed=False,
    unweighted=False,
)

print(int(dist_mat.max()))


### FIXED CODE ###

from scipy.sparse.csgraph import dijkstra, csgraph_from_dense
import numpy as np

H, W = map(int, input().split())
S = [input() for _ in range(H)]

v_id_dict = {}
dista = np.ones((400, 400)) * np.inf

for i in range(H):
    for j in range(W):
        if S[i][j] == ".":
            v_id_dict[i, j] = len(v_id_dict)

            if (i > 0) and (S[i - 1][j] == "."):
                dista[v_id_dict[(i, j)], v_id_dict[(i - 1, j)]] = 1

            if (j > 0) and (S[i][j - 1] == "."):
                dista[v_id_dict[(i, j)], v_id_dict[(i, j - 1)]] = 1

dist_mat = dijkstra(
    csgraph_from_dense(dista[: len(v_id_dict), : len(v_id_dict)]),
    directed=False,
    unweighted=False,
)

print(int(dist_mat.max()))
n = input()
ans = 0
for i in range(len(n)):
  if n[i] == "7":
	ans += 1
print("Yes" if ans > 0 else "No")

### FIXED CODE ###

n = list(input())
ans = 0
for i in range(len(n)):
  if n[i] == "7":
    ans += 1
print("Yes" if ans > 0 else "No")
print max([sum(map(int,raw_input().split())) for i in range(map(int,raw_input().split())[0])]

### FIXED CODE ###

print max([sum(map(int,raw_input().split())) for i in range(map(int,raw_input().split())[0])])
#!/usr/bin/env python3

import numpy as np
nmx = input().split(" ")
n = int(nmx[0])
m = int(nmx[1])
x = int(nmx[2])
a = []
c = []
tanka = []
noryoku = [0] * m

r = 0

for i in range(n):
  text = input().split(" ")
  price = int(text[0])
  c.append(price)
  a.append([int(text[i]) for i in range(1, m + 1)])
  tanka.append([price / int(text[i]) for i in range(1, m + 1)])

a = np.array(a)
# price = np.array(price)

while len(tanka) > 0:
  min_i = np.argmin(tanka, axis=0)
  min_v = np.min(tanka, axis=0)
  index = min_i[np.argmax(min_v)]
  # print(min_i)

  # for j in range(m):
  #   noryoku[j] += a[min_i][j]

  noryoku = [noryoku[j] +  a[index][j] for j in range(m)]
  r += c[index]

  if all(v >= x for v in noryoku):
    print(r)
    break

  tanka = np.delete(tanka, index, 0)
  a = np.delete(a, index, 0)
  c.pop(index)

else:
  print(-1)

### FIXED CODE ###

#!/usr/bin/env python3

import numpy as np
nmx = input().split(" ")
n = int(nmx[0])
m = int(nmx[1])
x = int(nmx[2])
a = []
c = []
total = []
pattern = [[0] * n]

for i in range(pow(2, n) - 1):
  pattern.append([pattern[i][j] for j in range(n)])
  for j in range(n):
    if pattern[i+1][j] == 0:
      pattern[i+1][j] = 1
      break
    else:
      pattern[i+1][j] = 0

r = 0

for i in range(n):
  text = input().split(" ")
  c.append(int(text[0]))
  a.append([int(text[i]) for i in range(1, m + 1)])

a = np.array(a)

for i in range(pow(2, n) - 1, -1,  -1):
  array = a.T @ pattern[i]
  if not(all(v >= x for v in array)):
    pattern = np.delete(pattern, i, 0)


total = [np.dot(np.array(c), p) for p in pattern]
# print(pattern)
# print(total)

if len(total) > 0:
  print(min(total))
else:
  print(-1)
s = [input() for i in range(2)]
#出力['s_1', 's_2']

x=s[0].split(',')
y=s[1].split(',')

if x[0]==y[0]:
  ans += 1
  if x[1]==y[1]:
    ans += 1
    if x[2]==y[2]:
      ans += 1
print(ans)

### FIXED CODE ###

S=input()
T=input()

ans=0
for s,t in zip(S,T):
  if s==t:
    ans+=1
print(ans)
a=int(input())
b=int(input())
c=a*b
if c%2==0:
    print(Even)
else:
    print(Odd)

### FIXED CODE ###

a,b=map(int,input().split())
c=a*b
if c%2==0:
    print('Even')
else:
    print('Odd')
N = raw_input()
V = raw_input()
C = raw_input()

Va = V.split(" ")
Ca = C.split(" ")

Va = map(lambda x: int(x), Va)
Ca = map(lambda x: int(x), Ca)


X = 0
Y = 0
for v, c in zip(Va, Ca):
  if v > c:
    X += v
    Y += c

print(X - Y)



### FIXED CODE ###

N = raw_input()
V = raw_input()
C = raw_input()

Va = V.split(" ")
Ca = C.split(" ")

Va = map(lambda x: int(x), Va)
Ca = map(lambda x: int(x), Ca)


X = 0
Y = 0
for v, c in zip(Va, Ca):
  if v > c:
    X += v
    Y += c

print(X - Y)
from collections import defaultdict


N, M = map(int, input().split())
parent = defaultdict(lambda: -1)


def union(x, y):
    x = find(x)
    y = find(y)
    if x == y:
        return
    parent[x] = y


def find(x):
    if parent[x] == -1:
        return x
    res = parent[x] = find(parent[x])
    return res

for _ in range(M):
    a, b = map(int, input().split())
    union(a - 1, b - 1)


count = defaultdict(int)
for i in range(N):
    count[find(i)] += 1
print(max(count.values()))

### FIXED CODE ###

from collections import Counter
import sys

sys.setrecursionlimit(10 ** 6)


N, M = map(int, input().split())
parent = [-1] * N


def union(x, y):
    x = find(x)
    y = find(y)
    if x == y:
        return
    parent[x] = y


def find(x):
    if parent[x] == -1:
        return x
    res = parent[x] = find(parent[x])
    return res

for _ in range(M):
    a, b = map(int, input().split())
    union(a - 1, b - 1)


count = Counter(find(i) for i in range(N))
print(count.most_common(1)[0][1])
X, Y, A, B, C = map(int, input().split())
P = sorted(list(map(int, input().split())), reverse=True)
Q = sorted(list(map(int, input().split())), reverse=True)
R = sorted(list(map(int, input().split())), reverse=True)

red = sorted(P[:X])
gre = sorted(Q[:Y])
ans = sum(red) + sum(gre) 
j, k = 0, 0

for i in range(min(X+Y,C)):
    if(red[j] <= gre[k]):
        if R[i] > red[j] :
            ans = ans - red[j] + R[i]
            j += 1
        else:
            break
    else:
        if R[i] > gre[k] :
            ans = ans - gre[k] + R[i]
            k += 1
        else:
            break
print(ans)

### FIXED CODE ###

X, Y, A, B, C = map(int, input().split())
P = sorted(list(map(int, input().split())), reverse=True)
Q = sorted(list(map(int, input().split())), reverse=True)
R = sorted(list(map(int, input().split())), reverse=True)

red = sorted(P[:X])
gre = sorted(Q[:Y])
m = min((X+Y),C)
n = R[:m]
red.extend(gre)
red.extend(n)
red = sorted(red, reverse=True)

print(sum(red[:X+Y]))
n = int(input())
t = [int(input()) for _ in range(n)]


def gcd(x,y):
  if y == 0:
    return x
  return gcd(y, x % y)


ans = t[0]
for x in t[1:]:
  ans = ans * t[i] // gcd(ans, t[i])
print(ans)

### FIXED CODE ###

n = int(input())
t = [int(input()) for _ in range(n)]


def gcd(x,y):
  if y == 0:
    return x
  return gcd(y, x % y)


ans = t[0]
for x in t[1:]:
  ans = ans * x // gcd(ans, x)
print(ans)
class SegTree:
    def __init__(self, N, S):
        self.N = 2 ** ((N-1).bit_length())
        self.tree = [0 for i in range(self.N * 2 - 1)]
        for i in range(len(S)):
            self.tree[self.N - 1 + i] = 1 << (ord(S[i] - ord("a")))

        for i in range(self.N - 2, -1, -1):
            self.tree[i] = self.tree[i*2 + 1] | self.tree[i*2 + 2]

    def update(self, index, char):
        i = self.N - 1 + index
        # アルファベットがある = bitが立っている
        self.tree[i] = 1 << (ord(char) - ord("a"))
        while i > 0:
            i = (i-1) // 2
            self.tree[i] = self.tree[i*2 + 1] | self.tree[i*2 + 2]

    def get(self, a, b):
        return self.query(a, b, 0, 0, self.N)

    # k : ノードの番号
    # l : ノードkの受け持つ区間
    # r : ノードkの受け持つ区間
    def query(self, a, b, k, l, r):
        if r <= a or b <= l: # 区間外
            return 0
        elif a <= l and r <= b: # 受け持ち区間は完全に含まれている
            return self.tree[k]
        else: # 一部含まれてる
            left = self.query(a, b, 2 * k + 1, l, (l+r)//2)
            right = self.query(a, b, 2 * k + 2, (l+r)//2, r)
            return left | right

def solve():
    N = int(input())
    S = list(input().strip())
    tree = SegTree(N, S)

    Q = int(input())
    for _ in range(Q):
        t_q, in_1, in_2 = input().split()
        if t_q == "1":
            i_q = int(in_1)
            c_q = in_2
            tree.update(i_q-1, c_q)
        else:
            l_q = int(in_1)
            r_q = int(in_2)
            print(bin(tree.get(l_q-1, r_q)).count(1))

solve()

### FIXED CODE ###

class SegTree:
    def __init__(self, N, S):
        self.N = 2 ** ((N-1).bit_length())
        self.tree = [0 for i in range(self.N * 2 - 1)]
        for i in range(len(S)):
            self.tree[self.N - 1 + i] = 1 << (ord(S[i]) - ord("a"))

        for i in range(self.N - 2, -1, -1):
            self.tree[i] = self.tree[i*2 + 1] | self.tree[i*2 + 2]

    def update(self, index, char):
        i = self.N - 1 + index
        # アルファベットがある = bitが立っている
        self.tree[i] = 1 << (ord(char) - ord("a"))
        while i > 0:
            i = (i-1) // 2
            self.tree[i] = self.tree[i*2 + 1] | self.tree[i*2 + 2]

    def get(self, a, b):
        return self.query(a, b, 0, 0, self.N)

    # k : ノードの番号
    # l : ノードkの受け持つ区間
    # r : ノードkの受け持つ区間
    def query(self, a, b, k, l, r):
        if r <= a or b <= l: # 区間外
            return 0
        elif a <= l and r <= b: # 受け持ち区間は完全に含まれている
            return self.tree[k]
        else: # 一部含まれてる
            left = self.query(a, b, 2 * k + 1, l, (l+r)//2)
            right = self.query(a, b, 2 * k + 2, (l+r)//2, r)
            return left | right

def solve():
    N = int(input())
    S = list(input().strip())
    tree = SegTree(N, S)

    Q = int(input())
    for _ in range(Q):
        t_q, in_1, in_2 = input().split()
        if t_q == "1":
            i_q = int(in_1)
            c_q = in_2
            tree.update(i_q-1, c_q)
        else:
            l_q = int(in_1)
            r_q = int(in_2)
            print(bin(tree.get(l_q-1, r_q)).count("1"))

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

demands= []

for i in range(m):
    demands.append(list(map(int,input().split())))

demans.sort()

cut = []

for d in demands:
    flag = True
    for c in cut:
        if c[0] < d[1] and c[1] > d[0]:
            flag = False
            c[0] = max(c[0],d[0])
            c[1] = min(c[1],d[1])
            break
    if flag:
        cut.append(d)

print(len(cut))

### FIXED CODE ###

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

d.sort(key=lambda x:x[1])
ans=0
c=0
for i in range(M):
    a,b=d[i]
    if a>=c:
        ans+=1
        c=b
print(ans)
# coding: utf-8
# Your code here!

box_num = int(input())
ball_in_box_num_list = ([int(i), []] for i in input().split(" "))
for i in range(1, box_num + 1):
    k = 2
    while i * k <= box_num:
        ball_in_box_num_list[i * k - 1][1].append(i - 1)
        k += 1
ans_num = 0
ans_list = []
for i in range(box_num):
    a = box_num - 1 - i
    b = ball_in_box_num_list[a]
    if b[0] == 1:
        ans_num += 1
        ans_list.append(a + 1)
        for j in b[1]:
            ball_in_box_num_list[j][0] = 1 - ball_in_box_num_list[j][0]
print(ans_num)
if ans_list != 0:
    ans_list = [str(i) for i in ans_list]
    ans_list = ans_list[::-1]
    print(" ".join(ans_list))

### FIXED CODE ###

# coding: utf-8
# Your code here!

box_num = int(input())
ball_in_box_num_list = tuple([int(i), []] for i in input().split(" "))
for i in range(1, box_num + 1):
    k = 2
    while i * k <= box_num:
        ball_in_box_num_list[i * k - 1][1].append(i - 1)
        k += 1
ans_num = 0
ans_list = []
for i in range(box_num):
    a = box_num - 1 - i
    b = ball_in_box_num_list[a]
    if b[0] == 1:
        ans_num += 1
        ans_list.append(a + 1)
        for j in b[1]:
            ball_in_box_num_list[j][0] = 1 - ball_in_box_num_list[j][0]
print(ans_num)
if ans_list != 0:
    ans_list = [str(i) for i in ans_list]
    ans_list = ans_list[::-1]
    print(" ".join(ans_list))
import sys
read = sys.stdin.readline
import time
import math
import itertools as it
def inpl():
    return list(map(int, input().split()))
st = time.perf_counter()
# ------------------------------

N, K = inpl()
A = inpl()
for i in range(K, N):
    if A[i] > A[i-K]:
        print('Yes')
    else:
        print('No')

# -----------------------------
ed = time.perf_counter()
print('time:', ed-st, file=sys.stderr)


### FIXED CODE ###

import sys
read = sys.stdin.readline
import time
import math
import itertools as it
def inpl():
    return list(map(int, input().split()))
st = time.perf_counter()
# ------------------------------

N = int(input())
if 400 <= N and N <= 599:
    ans = 8
elif 600 <= N and N <= 799:
    ans = 7
elif 800 <= N and N <= 999:
    ans = 6
elif 1000 <= N and N <= 1199:
    ans = 5
elif 1200 <= N and N <= 1399:
    ans = 4
elif 1400 <= N and N <= 1599:
    ans = 3
elif 1600 <= N and N <= 1799:
    ans = 2
elif 1800 <= N and N <= 1999:
    ans = 1


print(ans)



# ------------------------------
ed = time.perf_counter()
print('time:', ed-st, file=sys.stderr)
A, B = map(int, input().split())

import math

print(A * B // gcd(A, B))

### FIXED CODE ###

A, B = map(int, input().split())

import fractions 

print(A * B // fractions.gcd(A, B))
a,b,c = map(int,input().split())
max_ = max([a,b,c])
ls = [a,b,c]

if ls[0]%2 == ls[1]%2 == ls[2]%2:
    cnt = 2*max_- sum(ls)
    print(int(cnt/2))


ls.pop(max_)
if ls[0]%2 == ls[1]%2:
    cnt = 2*max_- sum(ls) -2
    print(int(cnt/2 +1))    
else:
    cnt = 2*max_- sum(ls) + 1
    print(int(cnt/2 +1))
print(cnt)
    

### FIXED CODE ###

a,b,c = map(int,input().split())
max_ = max([a,b,c])
ls = [a,b,c]

if ls[0]%2 == ls[1]%2 == ls[2]%2:
    cnt = 3*max_- sum(ls)
    print(int(cnt/2))


else:
    ls.remove(max_)
    if ls[0]%2 == ls[1]%2:
        cnt = 2*max_- sum(ls) -2
        print(int(cnt/2 +1))    
    else:
        cnt = 2*max_- sum(ls) + 1
        print(int(cnt/2 +1))
N = int(input())
H = map(int,input().split())
m = 0
c = 0
for i in range(N-1):
  if H[i] >= H[i+1]:
    c+=1
  else:
    m = max(m,c)
    c = 0
print(m)

### FIXED CODE ###

N = int(input())
H = list(map(int,input().split()))
m = 0
c = 0
for i in range(N-1):
  if H[i] >= H[i+1]:
    c+=1
  else:
    m = max(m,c)
    c = 0
m = max(m,c)
print(m)
import math
N = input()
i = list(map(int, input().split()))
result = 1
if 0 in i:
  print(0)
  return
for x in i:
  result *= x
  if(len(str(result)) >= 19):
    print(-1)
    return
print(result)

### FIXED CODE ###

import math
import sys
N = input()
i = list(map(int, input().split()))
result = 1
if 0 in i:
  print(0)
else:
  for x in i:
    result *= x
    if(result >= 10**18):
      break
  if(result > 10**18):
    print(-1)
  else:
    print(result)
s = input()
print('{0] {1}'.format(s[:4],s[4:]))

### FIXED CODE ###

a = input()
a = u'{0}'.format(a)
print('{0} {1}'.format(a[:4],a[4:]))
from collections import deque 
n,m = list(map(int,input().split()))
e = [[] for _ in range(m+1)]
for i in range(m):
    a,b = list(map(int,input().split()))
    e[a].append(b)
    e[b].append(a)

q = deque()
q.append(1)

s = [float('inf') for _ in range(n+1)]
t = [float('inf') for _ in range(n+1)]
s[1] = 0
t[1] = 0
while len(q):
    node = q.pop()
    step = s[node]
    for i in range(len(e[node])):
        if s[e[node][i]] > step +1:
            q.append(e[node][i])
            s[e[node][i]] = step + 1
            t[e[node][i]] = node
# print(s,t,e)
for i in range(2,n+1):
    print(t[i])

### FIXED CODE ###

from collections import deque

n,m = list(map(int,input().split()))
e = [[] for _ in range(n+1)]

for i in range(m):
    a,b = list(map(int,input().split()))
    e[a].append(b)
    e[b].append(a)
q = deque()
q.append(1)
t = [-1 for _ in range(n+1)]

while len(q):
    node = q.popleft()

    for i in range(len(e[node])):
        nex = e[node][i]
        if t[nex] == -1:
            q.append(nex)
            t[nex] = node
print("Yes")
for i in range(2,n+1):
    print(t[i])
import sys
import bisect as bi
import math
from collections import defaultdict as dd
import heapq
import itertools
input=sys.stdin.readline
from random import randint
##import numpy as np
##sys.setrecursionlimit(10**7)
mo=10**9+7
def cin():
    return map(int,sin().split())
def ain():            
    return list(map(int,sin().split()))
def sin():
    return input()
def inin():
    return int(input())
##def gcd(a,b): 
##    if a == 0: 
##        return b 
##    return gcd(b % a, a)
prime1=[]
def SieveOfEratosthenes(n): #list of primes upto n
    global prime1
    prime1 = [True for i in range(n+1)] 
    p = 2
    while (p * p <= n): 
        if (prime1[p] == True): 
            for i in range(p * p, n+1, p): 
                prime1[i] = False
        p += 1
    f=[]
    for p in range(2, n): 
        if prime1[p]: 
            f.append(p)
    return f

def lcm(a,b): 
    return (a*b) // math.gcd(a,b) 
for _ in range(1):
    n=inin()
    l=ain()
    f1,f2=0,0
    gc=l[0]
    d=dd(int)

    for i in range(1,n):
        gc=math.gcd(gc,l[i])
    if(gc!=1):print("not coprime")
    else:
        lp=SieveOfEratosthenes(int(max(l)**(0.5))+2)
        for i in l:
          	if(i!=1):
              for j in lp:
                  if(i%j==0):
                      if(d[j]==1):
                          f1=1
                          break
                      d[j]=1
              if(f1):break
        if(f1):
            print("setwise coprime")
        else:
            print("pairwise coprime")
        
        
    
    
    

 
    
    
    
    
        
        
    
    
    
    


    




##def msb(n):n|=n>>1;n|=n>>2;n|=n>>4;n|=n>>8;n|=n>>16;n|=n>>32;n|=n>>64;return n-(n>>1) #2 ki power
##def pref(a,n,f):             
##    pre=[0]*n
##    if(f==0):         ##from beginning
##        pre[0]=a[0]
##        for i in range(1,n):
##            pre[i]=a[i]+pre[i-1]
##    else:              ##from end
##        pre[-1]=a[-1]
##        for i in range(n-2,-1,-1):
##            pre[i]=pre[i+1]+a[i]
##    return pre
##maxint=10**24 
##def kadane(a,size): 
##    max_so_far = -maxint - 1
##    max_ending_here = 0
##       
##    for i in range(0, size): 
##        max_ending_here = max_ending_here + a[i] 
##        if (max_so_far < max_ending_here): 
##            max_so_far = max_ending_here 
##  
##        if max_ending_here < 0: 
##            max_ending_here = 0   
##    return max_so_far
##def power(x, y):
##    if(y == 0):return 1
##    temp = power(x, int(y / 2))%mo
##    if (y % 2 == 0):return (temp * temp)%mo 
##    else:
##        if(y > 0):return (x * temp * temp)%mo 
##        else:return ((temp * temp)//x )%mo


### FIXED CODE ###

import math
N=int(input())
m=10**6+1
M=[0]*m
g=0
for i in map(int,input().split()):M[i]+=1;g=math.gcd(g,i)
if g>1:print('not coprime')
elif all(sum(M[i::i])<=1 for i in range(2,m)):print('pairwise coprime')
else:print('setwise coprime')
print(int(input().split())**2)

### FIXED CODE ###

print(int(input())**2)
N = int(input())
*A, = map(int,input().split())

if N%3:
    ans = True
    for a in A:
        if a:ans=False;break
    1/0
else:
    B = set(A)
    l = len(B)
    ans = True
    if l>3 or l==2:ans = False
    elif l==1:
        for b in B:
            if b:ans=False;break
    else:
        a,b,c = B
        ans = ans and (A.count(a)==A.count(b)==A.count(c)==N//3) and (a^b==c)
        
if ans:print("Yes")
else:print("No")

### FIXED CODE ###

N = int(input())
*A, = map(int,input().split())

if N%3:
    ans = True
    for a in A:
        if a:ans=False;break
else:
    B = set(A)
    l = len(B)
    ans = True
    if l>3:
        ans = False
    elif l==1:
        for b in B:
            if b:ans=False;break
    else:
        if l==3:
            a,b,c = B
            l,m,n = (A.count(x) for x in (a,b,c))
        if l==2:
            a,b = B
            l,m = (A.count(x) for x in (a,b))
            if l>=m:
                c=a
                n=l//2
                l-=n
            else:
                c=b
                n=m//2
                m-=n
        ans = ans and (l==m==n==N//3) and (a^b==c)
        
if ans:print("Yes")
else:print("No")
b=int(input())
print('A' if b=='T' else 'T' if b=='A' else 'G' if b=='C' else 'C')

### FIXED CODE ###

b=input()
print('A' if b=='T' else 'T' if b=='A' else 'G' if b=='C' else 'C')
from math import factorial as f

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

if n == m:
    print((f(n) ** 2 * 2) % (10 ** 9 + 7))
elif abs(n - m) == 1:
    print((f(n) * f(m)) % (10 ** 9 + 7)) 
else:
    print(0)

### FIXED CODE ###

from math import factorial as f

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

if n == m:
    print((f(n) ** 2 * 2) % (10 ** 9 + 7))
elif abs(n - m) == 1:
    print((f(n) * f(m)) % (10 ** 9 + 7)) 
else:
    print(0)
p=1;a=[]
n=int(input());s=n**.5
while n%2==0 and n>3:a+=[2];n//=2
d=3
while s>d and n>d:
 if n%d==0:a+=[d];n//=d
 else:d+=2
a+=[n]
for f in set(a):
 p*=f**a.count(f)*(1-1/f)
print(int(p)


### FIXED CODE ###

p=n=int(input())
d=2
while d*d<=n:
 if n%d==0:
  p=p*(d-1)//d
  while n%d==0:n//=d
 d+=1
print([p,p*(n-1)//n][n>1])
import numpy as np

import sys
sys.setrecursionlimit(1000000)

n, W = map(int, input().split())
dp = np.zeros(W+1,'i8')
for i in range(n):
  w, v = map(int, input().split())
  #print(dp[w:],dp[:-w],dp)
  dp[w:] = np.maximum(dp[w:], dp[:-w]+v)
  #print(dp[w:],dp[:-w],dp)
print(dp[-1])

### FIXED CODE ###

N, W = map(int, input().split())
w, v = [0] * N, [0] * N
for i in range(N):
	w[i], v[i] = map(int, input().split())

sum_v = sum(v)

dp = [[10**18] * (sum_v + 1) for _ in range(N + 1)]

for i in range(N+1):
    dp[i][0] = 0
    
# dp[i][j](j=0,1,...,W)の値が求まっている状態で、dp[i+1][j]を更新することを考える
for i in range(N):
    for j in range(sum_v + 1):
		# 品物(w[i],v[i])を選ぶとき、j-w[i]>=0に限って、価値v[i]が加算される
        if j - v[i] == 0:
            dp[i + 1][j] = min(w[i],dp[i][j])
        if dp[i][j] != 10**18:
            dp[i+1][j+v[i]] = min(dp[i][j+v[i]],dp[i][j]+w[i])
		# 品物(w[i],v[i])を選ばないとき、何も加算しない
        dp[i + 1][j] = min(dp[i + 1][j], dp[i][j])

for i in range(sum_v + 1):
    #print(dp[N][sum_v - i],i)
    if dp[N][sum_v - i] <= W and dp[N][sum_v - i] != 0:
        print(sum_v - i)
        exit()

print(0)