Harryxun/stf_run huggingface dataset:
N=int(input())
a=10**12
for i in range(1,int(N**.5)+1):
    if N%i==0:
        a=min(a,N//n+n-2)
print(min(N,a))

### FIXED CODE ###

N=int(input())
a=10**12
for i in range(1,int(N**.5)+1):
    if N%i==0:
        a=min(a,N//i+i-2)
print(min(N,a))
n = int(input())
s = input()
num = int(input())
lst = [i if i==s[num] else "*" for i in s]
print(*lst, sep='')

### FIXED CODE ###

n = int(input())
a = input()
l = int(input())
for i in range(n):
  if a[l-1] != a[i]:
    print('*', end='')
  else:
    print(a[l-1], end='')
L, R=map(int, input().split())
mod=2019
A=[0]*(R-L+1)
for i in range(L. R+1):
  A[i]=i%mod
  
A=sorted(A)
print((A[0]*A[1])%mod)

### FIXED CODE ###

L,R=map(int, input().split())
#2019の倍数が入っていれば０→R-Lが２０１９以上
if R-L>=2019:
    print(0)
    exit()

ans=2019
for i in range(L,R):
    for j in range(i+1,R+1):
        ans=min(ans, (i*j)%2019)
print(ans)
import sys

def count(split_haichi):
    black_count = sum([x == '#' for x in split_haichi])
    white_count = sum([x == '.' for x in split_haichi])
    return min(black_count, white_count)

a = []
for l in sys.stdin:
    a.append(l)

num = int(a[0])
haichi = a[1]
count_list = []
for i in range(num-1):
    split_haichi_1 = haichi[:i+1]
    split_haichi_2 = haichi[i+1:]
    count_1 = count(split_haichi_1)
    count_2 = count(split_haichi_2)
    count_list.append(count_1 + count_2)

print(min(count_list))


### FIXED CODE ###

import sys
a = []
for l in sys.stdin:
    a.append(l)

zahyou = [int(x) for x in a[0].split()]
a, b, c = zahyou
if max(zahyou) == c or min(zahyou) == c:
    print("No")
else:
    print("Yes")
N, K = map(int, input().split())

if N < K:
    k = K % N
    ans = abs(N - k)
    print(ans)
elif N > K:
    k = N % K
    ans = abs(K - k)
    if k == 0:
        print("0")
    else:
        print(ans)
else:
    print("0")

### FIXED CODE ###

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

tmp = N // K

ans = N - K * tmp

ans = min(ans, abs(ans - K))

print(ans)
x = input()
l = { 25: "Christmas", 24: "Christmas Eve", 23: "Christmas Eve Eve", 22: "Christmas Eve Eve Eve" }
return l[int(x)]

### FIXED CODE ###

x = input()
l = { 25: "Christmas", 24: "Christmas Eve", 23: "Christmas Eve Eve", 22: "Christmas Eve Eve Eve" }
print(l[int(x)])
n=int(input())
s=str(input())
x=0
l=[0]
for i in range(n):
  if s[i]=='I':
    x+=1
    l.append(x)
  else:
    x-=1
    l.append(x)
print(max(x))


### FIXED CODE ###

n=int(input())
s=str(input())
x=0
l=[0]
for i in range(n):
  if s[i]=='I':
    x+=1
    l.append(x)
  else:
    x-=1
    l.append(x)
print(max(l))
n = int(input())
s, t = input().split()
 
print(" ")

### FIXED CODE ###

a = int(input())
b = int(input())
 
if (a != 1 and b != 1):
  print(1)
elif (a != 2 and b != 2):
  print(2)
else:
  print(3)
from operator import itemgetter

N = int(input())
AB = [[int(x) for x in input().split()]for _ in range(N)]
sum_time = sum([a for a,b in AB])
AB.sort(key=itemgetter(0))
AB.sort(key=itemgetter(1),reverse=True)
for a,b,t in AB:
    if(sum_time>b):
        print('No')
        break
    else:
        sum_time-=a
else:
    print('Yes')


### FIXED CODE ###

from operator import itemgetter

N = int(input())
AB = [[int(x) for x in input().split()]for _ in range(N)]
sum_time = sum([a for a,b in AB])
AB.sort(key=itemgetter(0))
AB.sort(key=itemgetter(1),reverse=True)
for a,b in AB:
    if(sum_time>b):
        print('No')
        break
    else:
        sum_time-=a
else:
    print('Yes')
from collections import *
from itertools import *
from bisect import *
from heapq import *
import copy
#import math

#N=int(input())
#X,Y=map(int,input().split())
#S=list(map(int,input().split()))
#S=[list(map(int,input().split())) for i in range(N)]



N,M=map(int,input().split())
sc=[list(map(int,input().split())) for i in range(M)]
dic={}
for s,c in sc:
    if not s in dic:
        dic.update({s:c})
    else:
        if dic[s]!=c:
            print(-1)
            exit()

data=""
for i in range(1,N+1):
    if not data and dic[i]==0:
        print(-1)
        exit()

    if i in dic:
        if dic[i]!=0 or i==N:
            data+=str(dic[i])
    else:
        if data:
            data+="0"
if data:
    print(data)
else:
    print(-1)
#print(Counter(sc))


### FIXED CODE ###

from collections import *
from itertools import *
from bisect import *
from heapq import *
import copy
#import math

#N=int(input())
#X,Y=map(int,input().split())
#S=list(map(int,input().split()))
#S=[list(map(int,input().split())) for i in range(N)]



N,M=map(int,input().split())
sc=[list(map(int,input().split())) for i in range(M)]
dic={}
for s,c in sc:
    if not s in dic:
        dic.update({s:c})
    else:
        if dic[s]!=c:
            print(-1)
            exit()
if not 1 in dic:
    data="1"
    Z=2
else:
    Z=1
    data=""

if N==1 and not dic:
    print(0)
    exit()
if N>1 and 1 in dic and dic[1]==0:
    print(-1)
    exit()

for i in range(Z,N+1):
    if i in dic:
        data+=str(dic[i])
    else:
        if data:
            data+="0"
if data:
    print(data)
else:
    print(-1)
#print(Counter(sc))
S = input()
black = 0
count = 0

for i in range(len(S)):
  if S[i] == "B":
    black += 1

def f(N, BW, black):
  if N == "B" or N =="W":
    return 0
  elif BW == "B":
    return f(N[1:], N[1], black - 1) + len(N) - black
  elif BW == "W":
    return f(N[1:], N[1], black)

print(f(S, S[0], black))

### FIXED CODE ###

S = input()
white = []
count = 0

for i in range(len(S)):
  if S[i] == "W":
    white.append(i)

for i in range(len(white)):
  count += white[i] - i

print(count)
a,b = int(input()),input()
j,l=0,[0]
for i in b:
	if i == "I":j+=1
	else:j-=1
	l.append(j)
print(max(l))

### FIXED CODE ###

a,b,c,d = map(int,input().split())
print(a*b if a*b > c*d else c*d)
#!/usr/bin/env python3
import math

def f(b, n):
    return n if (n < b) else f(b, n // b) + n % b

n = int(input())
s = int(input())

ans = -1
if n == s:
    ans = n + 1
else:
    for b in range(2, math.floor(n ** 0.5) + 1):
        if f(b, n) == s:
            ans = b
            break
    else:
        for p in range(1, math.ceil(n ** 0.5))[::-1]:
            b = (n - s) // p + 1
            if b != int(b):
                continue
            if f(b, n) == s:
                ans = b
                break
print(ans)


### FIXED CODE ###

#!/usr/bin/env python3
import math

def f(b, n):
    return n if (n < b) else f(b, n // b) + n % b

n = int(input())
s = int(input())

ans = -1
if n == s:
    ans = n + 1
else:
    for b in range(2, math.floor(n ** 0.5) + 1):
        if f(b, n) == s:
            ans = b
            break
    else:
        for p in range(1, math.ceil(n ** 0.5)):
            if (n - s) % p != 0:
                continue
            b = (n - s) // p + 1
            if math.floor(n ** 0.5) < b <= n and f(b, n) == s:
                ans = b
print(ans)
N,M = map(int, input().split())
a = [0]*M
for i in range(M):
    a[i] = int(input())

fib_memo = {}
def fib(n):
    if n < 3: return 1
    if n not in fib_memo:
        fib_memo[n] = fib(n-1) + fib(n-2)
    return fib_memo[n]

now = 0
count = 1
mod = 7+10**9
for i in a:
    count *= fib(i-now)
    count = count%mod
    if now == i:
        print(0)
        quit()
    now = i+1

count *= fib(N-now+1)

print(count%mod)

### FIXED CODE ###

# 再帰上限あげとく
import sys
sys.setrecursionlimit(10**6)

# 値入力
mod = 7+10**9
N,M = map(int, input().split())
a = [0]*M
for i in range(M):
    a[i] = int(input())

# メモ化フィボナッチ
# 参考:http://python-remrin.hatenadiary.jp/entry/2017/05/19/153228
fib_memo = {}
def fib(n):
    if n < 3: return 1
    if n not in fib_memo:
        fib_memo[n] = fib(n-1) + fib(n-2)
    return fib_memo[n]

now = 0 # 今いる場所と考える
count = 1
for i in a:
    count *= fib(i-now)
    count = count%mod
    if now == i:
        print(0)
        quit()
    now = i+1 # 穴を超えた次の段に移動する

# 最上段までを計算
count *= fib(N-now+1)
print(count%mod)
inp = input().split()
l = int(inp[0])
r = int(inp[1])

int_list = list(range(l,r+1))
l = len(int_list)
min_mod = 2018

for i in range(l):
    for j in range(l):
        if j > i:
            compare = int_list[i]*int_list[j]%2019
            if compare < min_mod:
                min_mod = compare


print(min_mod)




### FIXED CODE ###

inp = input().split()
l = int(inp[0])
r = int(inp[1])

if r - l > 2019:
    print(0)
else:
    int_list_pre = list(range(l,r+1))
    int_list = [s%2019 for s in int_list_pre]
    l_l = len(int_list)
    min_mod = 2018

    for i in range(l_l):
        for j in range(l_l):
            if j > i:
                compare = (int_list[i] * int_list[j])%2019
                if compare < min_mod:
                    min_mod = compare


    print(min_mod)
n,m,l=map(int,input().split())
matrix_a=[]
matrix_b=[]
matrix_c=[]
for i in range(n):
    matrix_a.append(list(map(int,input().split())))
for i in range(m):
    matrix_b.append(list(map(int,input().split())))
tmp_l=list()
for i in range(n):
    for j in range(l):
        tmp_n=0
        for k in range(m):
            tmp_n+=matrix_a[i][k]*matrix_b[k][j]
        tmp_l.append(tmp_n)
    matrix_c.append(tmp_l.copy())
    tmp_l.clear()
for a,b,c in matrix_c:
    print(a,b,c)

### FIXED CODE ###

n,m,l=map(int,input().split())
matrix_a=[]
matrix_b=[]
matrix_c=[]
for i in range(n):
    matrix_a.append(list(map(int,input().split())))
for i in range(m):
    matrix_b.append(list(map(int,input().split())))
tmp_l=list()
for i in range(n):
    for j in range(l):
        tmp_n=0
        for k in range(m):
            tmp_n+=matrix_a[i][k]*matrix_b[k][j]
        tmp_l.append(tmp_n)
    matrix_c.append(tmp_l.copy())
    tmp_l.clear()
for i in matrix_c:
    tmp=0
    for j in i:
        tmp+=1
        if tmp==l:
            print(j,end="")
        else:
            print(j,"",end="")
    print()
a, b, c, d, e, f = map(int, input().split())
water = []
for i in range(31):
    for j in range(31):
        if a * i * 100 + b * j * 100 >= 3000:
            break
        water.append(a * i * 100 + b * j * 100)
        
water = sorted(list(set(water)))
sugar = []
for i in range(3001):
    for j in range(3001):
        if c * i + d * j >= 3000:
            break
        sugar.append(c * i + d * j)
        
sugar = sorted(list(set((sugar))))
sugar_ratio = 0
for i in water:
    for j in sugar:
        if i != 0 and j != 0:
            if (i + j) <= f:
                if j / i * 100 <= e:
                    if j / (i + j) > sugar_ratio:
                        sugar_ratio = j / (i + j)
                        ans_sugar_water = i + j
                        ans_sugar = j
            
            
print(ans_sugar_water, ans_sugar)

### FIXED CODE ###

a,b,c,d,e,f = map(int, input().split())
water_list = []
for i in range(f+1):
    for j in range(f+1):
        water = a * 100 * i + b * 100 * j
        if water <= f:
            water_list.append(water)
        else:
            break
            
sugar_list = []
for i in range(f+1):
    for j in range(f+1):
        sugar = c * i + d * j
        if sugar <= f:
            sugar_list.append(sugar)
        else:
            break
            
ans = []
for i in list(set(water_list)):
    for j in list(set(sugar_list)):
        if i != 0:
            if float(j) / i  <= e / 100 and (i + j) <= f:
                ans.append((i+j, j))
                
ans_sorted = sorted(ans, key=lambda x: (x[1] / (x[0])))[-1]
print(ans_sorted[0],ans_sorted[1])
import sys
A,B,C,D = list(map(int,input().split()))

while True:
  C = C - B
  A -= D
  print(C)
  print(A)
  if C <= 0:
    print("Yes")
    sys.exit(1)
  elif A <= 0:
    print("No")
    sys.exit(1)

### FIXED CODE ###

import sys
A,B,C,D = list(map(int,input().split()))

while True:
  C = C - B
  A -= D
  if C <= 0:
    print("Yes")
    sys.exit(0)
  elif A <= 0:
    print("No")
    sys.exit(0)
K=int(input())
A, B = map(int, input().split())
a=A//K
b=A%K
c=B%K

if(b==0 or c==0):
  print("OK")
else:
  if(1<a):
    if(a*K<=B):
      print("OK")
    else:
      print("NG")
  else:
    print("NG")
~                  

### FIXED CODE ###

K=int(input())
A, B = map(int, input().split())
a=A//K
b=A%K
c=B%K

if(b==0 or c==0):
  print("OK")
else:
  if(1<a):
    if(a*K<=B):
      print("OK")
    else:
      print("NG")
  else:
    print("NG")
import logging
from math import factorial

logging.basicConfig(level=logging.INFO, format="%(message)s")
#logging.disable(logging.CRITICAL)

steps_memo =[0 for _ in range(10000)]
def cal_steps(num):
    steps_memo[0] = 1
    steps_memo[1] = 1

    for i in range(2, num):
        steps_memo[i] = steps_memo[i - 1] + steps_memo[i - 2]

    return steps_memo[num - 1]
    
def main():
    N, M = (int(x) for x in input().split())
    a_s = [int(input()) for _ in range(M)]

    logging.info(a_s)
    
    a_s.append(N + 1)
    a_s.insert(0, -1)
    diff_a = [a_s[i + 1] - a_s[i] - 1 for i in range(M + 1)]

    if diff_a[0] == 0:
        diff_a[0] = 1
    
    logging.info(diff_a)

    
    answer = 1
    for i in diff_a:
        answer *= int(cal_steps(i))

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

if __name__ == "__main__":
    main()


### FIXED CODE ###

import logging
from math import factorial

logging.basicConfig(level=logging.INFO, format="%(message)s")
#logging.disable(logging.CRITICAL)

steps_memo =[0 for _ in range(150000)]
def cal_steps(num):
    steps_memo[0] = 1
    steps_memo[1] = 1

    for i in range(2, num):
        steps_memo[i] = steps_memo[i - 1] + steps_memo[i - 2]

    return steps_memo[num - 1]
    
def main():
    N, M = (int(x) for x in input().split())
    a_s = [int(input()) for _ in range(M)]

    logging.info(a_s)
    
    a_s.append(N + 1)
    a_s.insert(0, -1)
    diff_a = [a_s[i + 1] - a_s[i] - 1 for i in range(M + 1)]

    if diff_a[0] == 0:
        diff_a[0] = 1
    
    logging.info(diff_a)

    
    answer = 1
    for i in diff_a:
        answer *= int(cal_steps(i))

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

if __name__ == "__main__":
    main()
a = list(map(int, input().split()))
a.sort()
k = int(input())
a[2] = a[2]*2**k
print(sum(a))

### FIXED CODE ###

a,b = map(int, input().split())
if a > b:
  print(a-1)
else:
  print(a)
s = list(input())

if s[0] == s[1] or s[1] == s[2] or s[2] == s[3] or s[3] == s[4]:
    print('Bad')
else:
    print('Good')


### FIXED CODE ###

s = list(input())

if s[0] == s[1] or s[1] == s[2] or s[2] == s[3]:
    print('Bad')
else:
    print('Good')
a,b,k=map(int,input().split())
print([i for i in range(min(a,b)) if i%a==0 and i%b==0][-k])

### FIXED CODE ###

a,b,k=map(int,input().split())
print([i for i in range(1,min([a,b])+1) if a%i==0 and b%i==0][-k])
n = int(input())
a = list(map(int, input().split()))

uv = [[] for _ in range(n)]
for _ in range(n-1):
    i, j = map(int, input().split())
    uv[i-1].append(j-1)
    uv[j-1].append(i-1)

# DFS
# 頂点iが未探索の時、ans[i] = -1
ans = [-1 for _ in range(n)]
ans[0] = 1
# dp[i] = 長さi+1のLISの最後尾の最小値
dp = [a[0]]
# history[(i, j)]のとき、変更前はdp[i] = j
# stackとして使用
history = []
# 頂点parents[i] = iの親
parents = [-1 for _ in range(n)]

todo = []
for i in uv[0]:
    todo.append(i)
    parents[i] = 0

while True:
    i = todo.pop(-1)
    
    # ans[i]を求める
    if dp[-1] < a[i]:
        dp.append(a[i])
        history.append((-1, 0))
    else:
        # dpの変更点を二分探索
        start = 0
        stop = len(dp) - 1
        flag = True
        while start < stop:
            center = (start + stop) // 2
            if dp[center] < a[i]:
                start = center + 1
            elif dp[center] > a[i]:
                stop = center
            else:
                flag = False
                break
        if flag and dp[start] > a[i]:
            history.append((start, dp[start]))
            dp[start] = a[i]
    ans[i] = len(dp)

    # todoに追加
    for j in uv[i]:
        if ans[j] == -1:
            todo.append(j)
            parents[j] = i

    if len(todo) == 0:
        break

    # back
    j = i
    while parents[todo[-1]] != j:
        k = history.pop(-1)
        if k[0] == -1:
            dp.pop(-1)
        else:
            dp[k[0]] = k[1]
        j = parents[j]

for i in ans:
    print(i)

### FIXED CODE ###

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

uv = [[] for _ in range(n)]
for _ in range(n-1):
    i, j = map(int, input().split())
    uv[i-1].append(j-1)
    uv[j-1].append(i-1)

# DFS
# 頂点iが未探索の時、ans[i] = -1
ans = [-1 for _ in range(n)]
ans[0] = 1
# dp[i] = 長さi+1のLISの最後尾の最小値
dp = [a[0]]
# history[(i, j)]のとき、変更前はdp[i] = j
# stackとして使用
history = []
# 頂点parents[i] = iの親
parents = [-1 for _ in range(n)]

todo = []
for i in uv[0]:
    todo.append(i)
    parents[i] = 0

while True:
    i = todo.pop(-1)
    
    # ans[i]を求める
    if dp[-1] < a[i]:
        dp.append(a[i])
        history.append((-1, 0))
    else:
        # dpの変更点を二分探索
        start = 0
        stop = len(dp) - 1
        flag = True
        while start < stop:
            center = (start + stop) // 2
            if dp[center] < a[i]:
                start = center + 1
            elif dp[center] > a[i]:
                stop = center
            else:
                flag = False
                break
        if flag and dp[start] > a[i]:
            history.append((start, dp[start]))
            dp[start] = a[i]
        else:
            history.append((-2, 0))
    ans[i] = len(dp)

    # todoに追加
    for j in uv[i]:
        if ans[j] == -1:
            todo.append(j)
            parents[j] = i

    if len(todo) == 0:
        break

    # back
    j = i
    while parents[todo[-1]] != j:
        k = history.pop(-1)
        if k[0] == -2:
            None
        elif k[0] == -1:
            dp.pop(-1)
        else:
            dp[k[0]] = k[1]
        j = parents[j]

for i in ans:
    print(i)
n=int(input())
s=input().strip()
a='ABCDEFGHIJKLMNLPQRSTUVWXYZ'
aa = dict()
for i, c in enumerate(a):
    aa[c] = i
def f(c):
    return a[(aa[c] + n)%26]

r = ''
for c in s:
    r += f(c)
print(r)


### FIXED CODE ###

n=int(input())
s=input().strip()
a='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
aa = dict()
for i, c in enumerate(a):
    aa[c] = i
def f(c):
    return a[(aa[c] + n)%26]

r = ''
for c in s:
    r += f(c)
print(r)
A,B map(int,input().split())
print(int(A/B))

### FIXED CODE ###

A,B = map(int,input().split())
C=A/B
if(C>int(A/B)):
  D=int(A/B)+1
else:
  D=int(A/B)
print(D)
n = raw_input()
data = raw_input().split(" ")

#data = [10, 1, 5, 4, 17]

minimum = 1000001
maximum = 0
goukei = 0

for i in data:
	if i < minimum:
		minimum = i
	if i > maximum:
		maximum = i
	goukei += i

print("{:} {:} {:}".format(minimum, maximum, goukei))

### FIXED CODE ###

n = int(raw_input())
data = map(int, raw_input().split(" "))

#data = [10, 1, 5, 4, 17]

minimum = data[0]
maximum = data[0]
goukei = 0

for i in data:
	if i < minimum:
		minimum = i

	if i > maximum:
		maximum = i

	goukei += i

print("{:} {:} {:}".format(minimum, maximum, goukei))
n = int(input())
a = [int(input()) for _ in range(n)]

for i in range(n):
    t = a[:]
    print(max(t.pop(i)))


### FIXED CODE ###

n = int(input())
maxindex = maxvalue = 0
a = []
for i in range(n):
    _a = int(input())
    if maxvalue <= _a:
        maxvalue = _a
        maxindex = i
    a.append(_a)

for i in range(n):
    if i != maxindex:
        print(maxvalue)
        continue
    t = a[:]
    t.pop(i)
    print(max(t))
N, M = map(int, input().split())
AB = []
for _ in range(M):
    AB.append(list(map(int, input().split())))

list = [0] * (N+1)

saitan = [1]
for _ in range(M):
    next = []
    for i in range(len(AB)):
        if AB[i][0] in saitan:
            if list[AB[i][1]] == 0:
                list[AB[i][1]] = AB[i][0]
                next.append(AB[i][1])
        if AB[i][1] in saitan:
            if list[AB[i][0]] == 0:
                list[AB[i][0]] = AB[i][1]
                next.append(AB[i][0])
    saitan.extend(next)


print("YES")
for ele in list[2:]:
    print(ele)


### FIXED CODE ###

n = int(input()[-1])
if n == 3:
    ans = "bon"
elif n in [0,1,6,8]:
    ans = "pon"
else:
    ans = "hon"
print(ans)
x,y = map(int, input().split())
a=0
b=0
if x=="A":
  a=10
elif x=="B":
  a=11
elif x=="C":
  a=12
elif x=="D":
  a=13
elif x=="E":
  a=14
elif x=="F":
  a=15
  
  
if y=="A":
  b=10
elif y=="B":
  b=11
elif y=="C":
  b=12
elif y=="D":
  b=13
elif y=="E":
  b=14
elif y=="F":
  b=15

if a<b:
  print("<")
elif a>b:
  print(">")
elif a==b:
  print("=")


### FIXED CODE ###

x,y = map(str, input().split())
a=0
b=0
if x=="A":
  a=10
elif x=="B":
  a=11
elif x=="C":
  a=12
elif x=="D":
  a=13
elif x=="E":
  a=14
elif x=="F":
  a=15
  
  
if y=="A":
  b=10
elif y=="B":
  b=11
elif y=="C":
  b=12
elif y=="D":
  b=13
elif y=="E":
  b=14
elif y=="F":
  b=15

if a<b:
  print("<")
elif a>b:
  print(">")
elif a==b:
  print("=")
n=map(int,input())
sun_n=0
for i in range(n+1):
  sun_n+=i
 print(sun_n)

### FIXED CODE ###

n=int(input())
sum_n=0
for i in range(n+1):
  sum_n+=i
print(sum_n)
point = [0]*n
app = [0]*n
cnt = []

for i in ab:
    app[i[0]-1] += 1
    app[i[1]-1] += 1
    if h[i[0]-1] > h[i[1]-1]:
        point[i[0]-1] += 1
    elif h[i[0]-1] < h[i[1]-1]:
        point[i[1]-1] += 1
for i in range(n):
    if app[i] == point[i]:
        cnt.append(i+1)
print(cnt)

### FIXED CODE ###

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

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

mj = []

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

cnt_w = [0 for _ in range(n)]
cnt = [0 for _ in range(n)]

for i in range(m):
    cnt[mj[i][0]-1] += 1
    cnt[mj[i][1]-1] += 1
    if h[mj[i][0]-1] > h[mj[i][1]-1]:
        cnt_w[mj[i][0]-1] += 1
    elif h[mj[i][0]-1] < h[mj[i][1]-1]:
        cnt_w[mj[i][1]-1] += 1

tower = 0
for i in range(n):
    if cnt[i] == cnt_w[i]:
        tower += 1
print(tower)
N, Q = map(int, input().split())

v = [[] for i in range(N)]
score = [0]*N

def dfs(p, x):
  for i in v[p-1]:
    if p < i:
      score[i-1] += x
      dfs(i, x)
      
for i in range(N-1):
  a, b = map(int, input().split())
  v[a-1].append(b)
  v[b-1].append(a)

for j in range(Q):
  p, x = map(int, input().split())
  score[p-1] += x
  dfs(p, x)
score_int=[str(a) for a in score]
output= ' '.join(score_int)
print(output)
  

### FIXED CODE ###

import sys
input = sys.stdin.readline #for input speed
sys.setrecursionlimit(10**6) #for deep recursion

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

v = [[] for i in range(N)]
score = [0]*N

def dfs(cur,par):
  for chi in v[cur]:
    if chi == par:
      continue
    score[chi] += score[cur]
    dfs(chi, cur)
      
for i in range(N-1):
  a, b = map(int, input().split())
  a -= 1
  b -= 1
  v[a].append(b)
  v[b].append(a)

for j in range(Q):
  p, x = map(int, input().split())
  score[p-1] += x

dfs(0,-1)
score_int=[str(a) for a in score]
output= ' '.join(score_int)
print(output)
if __name__ == "__main__":
    b = tuple(map(int, input().split(" ")))
    if b == "A":
        print("T")
    if b == "T":
        print("A")
    if b == "C":
        print("G")
    if b == "G":
        print("C")

### FIXED CODE ###

if __name__ == "__main__":
    b = input()
    if b == "A":
        print("T")
    if b == "T":
        print("A")
    if b == "C":
        print("G")
    if b == "G":
        print("C")
s = list(input())
t = list(input())
n = int(len(t))
if s =  t[0:n-1]:
  print('Yes')
else:
  print('No')


### FIXED CODE ###

s = list(input())
t = list(input())
n = int(len(t))
m = int(len(s))
if s == t[0:n-1] and n-1 == m:
  print('Yes')
else:
  print('No')
n, d = map(int,input().split())
ans = 0

for i in range(x):
  x, y = map(int,input().split())
  z = (x**2 + y**2)**0.5
  if z <= d:
    ans += 1

print(ans)

### FIXED CODE ###

n, d = map(int,input().split())
ans = 0
 
for i in range(n):
  x, y = map(int,input().split())
  z = (x**2 + y**2)**0.5
  if z <= d:
    ans += 1

print(ans)
d = '2 7 4'
 d = input()
d = [int(i) for i in d.split()]
d.sort()
s1 = 0
s2 = 0
i = len(d)-1
while(i>=0):
    s1 = s1 + d[i]
    if((i-1)>=0):
        s2 = s2 + d[i-1]
    i = i-2
print(s1-s2)




### FIXED CODE ###

d = '2 7 4'
d = input()
d = input()
d = [int(i) for i in d.split()]
d.sort()
s1 = 0
s2 = 0
i = len(d)-1
while(i>=0):
    s1 = s1 + d[i]
    if((i-1)>=0):
        s2 = s2 + d[i-1]
    i = i-2
print(s1-s2)
x,n,t = map(str,input().split())
cnt =0
while x > 0:
    x -= n
    cnt += 2
print(cnt * t)

### FIXED CODE ###

want, max, time = map(int, input().split())
if want % max == 0:
  required = int(want / max)
else:
  required = int(want / max + 1)
print(required * time)
A=int(input())
print(6-A-int(input())

### FIXED CODE ###

A=int(input())
print(6-A-int(input()))