Harryxun/stf_run huggingface dataset:
import sys
import math
from math import gcd as bltin_gcd
if sys.platform =='ios':
	sys.stdin=open('Untitled.txt')
input = sys.stdin.readline

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

def make_divisors(n):
    divisors = []
    for i in range(1, int(n**0.5)+1):
        if n % i == 0:
            divisors.append(i)
            if i != n // i:
                divisors.append(n//i)

    divisors.sort()
    return divisors

# nの素数判定
def is_prime(n):
    if n == 1:
        return False
    for i in range(2,int(n**0.5)+1):
        if n % i == 0:
            return False
    return True

N=(math.gcd(A, B))
#print(N)
div = make_divisors(N)
#print(div)

ans = 1 # divに1が含まれているため（互いに素の中で必ず1は選べる）
for d in div:
	ans += 1 if is_prime(d) else 0

print(ans)

### FIXED CODE ###

import sys
import fractions
if sys.platform =='ios':
	sys.stdin=open('Untitled.txt')
input = sys.stdin.readline

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

def make_divisors(n):
		divisors = []
		for i in range(1, int(n**0.5)+1):
				if n % i == 0:
						divisors.append(i)
						if i != n // i:
								divisors.append(n//i)

		divisors.sort()
		return divisors

# nの素数判定
def is_prime(n):
		if n == 1:
				return False
		for i in range(2,int(n**0.5)+1):
				if n % i == 0:
						return False
		return True

N=(fractions.gcd(A, B))
#print(N)
div = make_divisors(N)
#print(div)

ans = 1 # divに1が含まれているため（互いに素の中で必ず1は選べる）
for d in div:
	ans += 1 if is_prime(d) else 0

print(ans)
import math as m
a,b=map(float,input())
k=a*b
print(m.floor(k))

### FIXED CODE ###

a,b=map(float,input().split())
a=int(a)
b=round(b*100)
k=int((a*b)//100)
print(k)
from math import gcd
from fractions import gcd

a, b = map(int, input().split())

def lcm(a,b):
    return a * b // gcd(a,b)

print(lcm(a, b))

### FIXED CODE ###

from fractions import gcd

a, b = map(int, input().split())

def lcm(a,b):
    return a * b // gcd(a,b)

print(lcm(a, b))
import math

a, b, c = map(int, input().split())

if math.sqrt(a) + math.sqrt(b) > 31,622.77660168379:
    print("No")
else:
    if math.sqrt(a) + math.sqrt(b) < math.sqrt(c):
        print("Yes")
    else:
        print("No")


### FIXED CODE ###

from decimal import Decimal

a, b, c = map(int, input().split())

if Decimal(a).sqrt() + Decimal(b).sqrt() < Decimal(c).sqrt():
    print("Yes")
else:
    print("No")
L, R = map(int,input().split())
L_mod = L%2019
if L_mod ==0:
  print(0)
else:
  R_mod = R%2019
  if R_mod ==0:
    print(0)
  else:
    if L_mod<R_mod:
      list =[]
      for i in range(L_mod,R_mod,1):
        mod_i = i%2019
        for j in range(i+1,R_mod+1,1):
          mod_j = j%2019
          mod = (mod_i *mod_j)%2019
          list.append(mod)

      print(min(list))
      
    else:
      print(0)

### FIXED CODE ###

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

train = N*A
taxi = B

if train>=taxi:
  print(taxi)
else:
  print(train)
# -*- coding: utf-8 -*-
import copy
# スペース区切りの整数の入力
N = int(input())
X = list(map(int, input().split()))
md = int(N/2)
d = {}
for x in X:
    if x in d:
        d[x] += 1
    else:
        d[x] = 1

for i in range(N):
    d_cp = copy.deepcopy(d)
    d_cp[X[i]] += -1 
    sum_w = 0
    cum = []
    for i, key in enumerate(d_cp):
        sum_w += d_cp[key]
        cum.append([i,key,sum_w])
    for i,key,c in cum:
        if c >= md:
            print(key)
            break

### FIXED CODE ###

# -*- coding: utf-8 -*-
# スペース区切りの整数の入力
A,B,X = map(int, input().split())

if A + B >= X and A <= X:
    print('YES')
else:
    print('NO')
S=list(input())
S.append(0)
count=0
people=0
x=[]
x.append(-1)
y=[]
z=[]
for i in range(10**5):
    if S[i]==0:
        All = i
        y.append(0)
        break
    if S[i]=='L':
        if S[i+1]=="R":
            x.append(i)
        if S[i+1]==0:
            x.append(i)
    if S[i]=="R":
        if S[i+1]=="L":
            y.append(i)
for j in range(All):
    if j == y[count]:
        people=x[count+1]-x[count]
        if(people%2==0):
            z.append(people//2)
            z.append(people//2)
            print(1)
        else:
            if((y[count]-x[count])%2!=0):
                z.append(people//2+1)
                z.append(people//2)
            else:
                z.append(people//2)
                z.append(people//2+1)
    elif j-1==y[count]:
        count+=1
    else:
        z.append(0)
print(*z)

### FIXED CODE ###

S=list(input())
S.append(0)
count=0
people=0
x=[]
x.append(-1)
y=[]
z=[]
for i in range(10**5+1):
    if S[i]==0:
        All = i
        y.append(0)
        break
    if S[i]=='L':
        if S[i+1]=="R":
            x.append(i)
        if S[i+1]==0:
            x.append(i)
    if S[i]=="R":
        if S[i+1]=="L":
            y.append(i)
for j in range(All):
    if j == y[count]:
        people=x[count+1]-x[count]
        if(people%2==0):
            z.append(people//2)
            z.append(people//2)
        else:
            if((y[count]-x[count])%2!=0):
                z.append(people//2+1)
                z.append(people//2)
            else:
                z.append(people//2)
                z.append(people//2+1)
    elif j-1==y[count]:
        count+=1
    else:
        z.append(0)
print(*z)
N=int(input())

A=[int(i) for i in input().split()]


c=[0,0,0]
ans=1

for i in range(N):
    s=sum([c[j]==A[i] for j in range(0,3)])
    c[c.index(A[i])]+=1
    ans=(ans*s)%1000000007

print(ans%1000000007)

### FIXED CODE ###


N=int(input())

A=[int(i) for i in input().split()]


c=[0,0,0]
ans=1
uncho=True

for i in range(N):
    s=sum([c[j]==A[i] for j in range(0,3)])
    if s==0:
        uncho=False
        print(0)
        break
    c[c.index(A[i])]+=1
    ans=(ans*s)%1000000007

if uncho:
    print(ans%1000000007)
import math
A,B,C=map(int,input().split())
f=C%math.gcd(A,B)==0
print('YES' if f else 'NO')

### FIXED CODE ###

import fractions

A,B,C=map(int,input().split())
f=C%fractions.gcd(A,B)==0
print('YES' if f else 'NO')
def check(a,b,c,d):
	while(a>0 and c>0):
		c-=b
		if(c==0):
			return 1
		a-=d
		if(a==0):
			return 0
	if(a<0):
		return 0
	if(c < 0)
		return 1
inp1=list(map(int,input().strip().split()))[:4]
a,b,c,d=inp1[0],inp1[1],inp1[2],inp1[3]
if(check(a,b,c,d)):
	print("Yes")
else:
	print("No")

### FIXED CODE ###

inp1=list(map(int,input().strip().split()))[:2]
s,w=inp1[0],inp1[1]
if(w >= s):
	print("unsafe")
else:
	print("safe")
import os
import sys
from collections import defaultdict, Counter
from itertools import product, permutations,combinations, accumulate
from operator import itemgetter
from bisect import bisect_left,bisect
from heapq import heappop,heappush,heapify
from math import ceil, floor, sqrt, gcd
from copy import deepcopy

def main():
    
    a,b = map(int, input().split())
    if a <= 8 and b <= 8:
        print("Yay!")
    else:
        print(":(")
    
if __name__ == "__main__":
    main()

### FIXED CODE ###

def main():
    
    a,b = map(int, input().split())
    if a <= 8 and b <= 8:
        print("Yay!")
    else:
        print(":(")
    
if __name__ == '__main__':
    main()
from math import gcd
N = int(input())
A = list(map(int,input().split()))
# N=3
# A=[12 ,15 ,18]
l=[0]*N
r=[0]*N
l[0]=A[0]
r[0]=A[N-1]
for i in range(1,N-1):
    l[i]=gcd(l[i-1],A[i])
    r[i]=gcd(r[i-1],A[i])    
gcdlist = [l[N-2],r[N-2]]
for i in range(N-2):
    gcdlist.append(gcd(l[i],r[N-3-i]))
# print(gcdlist)
print(max(gcdlist))

### FIXED CODE ###

from fractions import gcd
N = int(input())
A = list(map(int,input().split()))
# N=3
# A=[12 ,15 ,18]
l=[0]*N
r=[0]*N
l[0]=A[0]
r[0]=A[N-1]
for i in range(1,N-1):
    l[i]=gcd(l[i-1],A[i])
    r[i]=gcd(r[i-1],A[N-1-i])    
gcdlist = [1,l[N-2],r[N-2]]
for i in range(N-2):
    gcdlist.append(gcd(l[i],r[N-3-i]))
#print(gcdlist)
print(max(gcdlist))
l,n=map(int,input().split())
li=[input() for i in range(n)]
ans=sorted(li)
"""
for st in li :
  s += st
print(s)
"""
print(*s,sep="")

### FIXED CODE ###

n,l=map(int,input().split())
li=[input() for i in range(n)]
ans=sorted(li)
"""
for st in li :
  s += st
print(s)
"""
print(*ans,sep="")
prnt(int(input())**3)

### FIXED CODE ###

print(int(input())**3)
n=int(input())
p=[3,13,23,43,53,73,103,113,163,173,193,223,233,263,283,293,313,353,373,383,443,463,503,563,593,613,643,653,673,683,733,743,773,823,853,863,883,953,983,1013,1033,1063,1093,1103,1123,1153,1163,1193,1213,1223,1283,1303,1373,1423,1433,1453,1483,1493]
for i in range(n):
    print(p[i],end=' ')

### FIXED CODE ###

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

if n%0==0:
	print(0)
else:
	print(1)

### FIXED CODE ###

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

if n%k!=0:
	print(1)
else:
	print(0)
Q, H, S, D = input().split()
Q, H, S, D = int(Q), int(H), int(S), int(D) # price 0.25 0.5 1.0 2.0
N = int(input())

per_2l_price = [Q*8, H*4, S*2, D]
per_1l_price = [Q*4, H*2, S]
per_05_price = [Q*2, H]
per_025_price = [Q]
needtobuy_l = N
needtobuy_m = 0


def st_min(lt):
    min_num = 0
    min_ = 1000000000000000000000000
    for i in range(len(lt)):
        if lt[i] < min_:
            min_num = i
            min_ = lt[i]
    return min_num
st_min


if needtobuy_l >= 2.0:
    mn = st_min(per_2l_price)
    needtobuy_m += per_2l_price[mn] * (needtobuy_l // 2.0)
    needtobuy_l -= 2.0 * (needtobuy_l // 2.0)
print(needtobuy_l, needtobuy_m)
input()
if needtobuy_l >= 1.0:
    mn = st_min(per_1l_price)
    needtobuy_m += per_1l_price[mn] * (needtobuy_l // 1.0)
    needtobuy_l -= 1.0 * (needtobuy_l // 1.0)
print(needtobuy_l, needtobuy_m)
input()
if needtobuy_l >= 0.5:
    mn = st_min(per_05_price)
    needtobuy_m += per_05_price[mn] * (needtobuy_l // 0.5)
    needtobuy_l -= 0.5 * (needtobuy_l // 0.5)
print(needtobuy_l, needtobuy_m)
input()
if needtobuy_l >= 0.25:
    needtobuy_m += Q * (needtobuy_l // 0.25)
    needtobuy_l -= 0.25 * (needtobuy_l // 0.25)

print(int(needtobuy_m))


### FIXED CODE ###

Q, H, S, D = input().split()
Q, H, S, D = int(Q), int(H), int(S), int(D)
N = int(input())

needtobuy_l = N
needtobuy_m = 0
per_2l_price = [D,
                S*2, S+H*2, S+H+Q*2,
                H*4, H*3+Q*2, H*2+Q*4, H+Q*6,
                Q*8]
per_1l_price = [S,
                H*2, H+Q*2,
                Q*4]

if needtobuy_l % 2 == 0:
    mincost = min(per_2l_price)
    needtobuy_m = mincost * (needtobuy_l // 2)
else:
    mincost = min(per_2l_price)
    needtobuy_m = mincost * (needtobuy_l // 2)
    mincost = min(per_1l_price)
    needtobuy_m += mincost * 1

print(needtobuy_m)
import time
import random
N = int(input())
s = str(input())
maxlen = N//2
start = time.time()
def solve(tgt):
    for i in range(N-tgt*2+1):
        if s[i:i+tgt] in s[i+tgt:]:
            return True
    return False

ng = maxlen + 1
ok = 0
if N>650:
    ok = 2
first = 1
while ng-ok > 1:
    end = time.time()
    if end-start > 1.2:
        if ok >= 2370:
            assert()
        r = random.random.randint(ok,ng-1)
        print(r)
        exit()
    tgt = (ok+ng)//2
    if first == 1:
        tgt = (ok+ng)*31//32
        first = 0
    if solve(tgt):
        ok = tgt
    else:
        ng = tgt
print(ok)


### FIXED CODE ###

from collections import defaultdict as dd
N = int(input())
s = str(input())
maxlen = N//2

def solve(tgt):
    dic = dd(int)
    st = s[tgt:2*tgt]
    dic[st] += 1
    ls = [st]
    for char in s[2*tgt:]:
        st = st[1:]+char
        dic[st] += 1
        ls.append(st)
    st = s[:tgt]
    if dic[st] > 0:
        return True
    dic[ls[0]] -= 1
    for i,char in enumerate(s[tgt:N-tgt]):
        st = st[1:]+char
        if dic[st] > 0:
            return True
        dic[ls[i+1]] -= 1
    return False

ng = maxlen + 1
ok = 0
while ng-ok > 1:
    tgt = (ok+ng)//2
    if solve(tgt):
        ok = tgt
    else:
        ng = tgt
print(ok)
if err2 < err:
            err = err2

### FIXED CODE ###

# メインアイデア
# T分割と||分割で差が小さい方を探す
# 90度回転させた場合も考える
# 総合的に小さい方を採用する
# 図的な解説は別のPDFをアップロードしてある
import sys
H, W = list(map(int, input().split()))

# 3の倍数の場合は即座に0とわかる
if (H * W) % 3 == 0:
    print(0)
    exit()


def try_divi(W, H):
    # パターン1
    err = W
    # パターン2
    w2, w3 = W // 2, W // 2
    if W % 2:
        w2 += 1
    for h1 in range(1, H // 2 + 1):
        h2 = H-h1
        S1, S2, S3 = h1*W, w2*h2, w3*h2
        new_err = max(S1, S2, S3) - min(S1, S2, S3)
        if new_err < err:
            err = new_err
    return err


print(min(try_divi(W, H), try_divi(H, W)))
n, k = map(int, input().split()) 
a_list = list(map(int, input().split())) 

rireki = [0] * (n+10)
curr_c = 1
rireki[1] = 0

no_loop_count = k
loop_cnt = 0

mugen = False
for i in range(n):
    next_c = a_list[curr_c-1]
    # print(i, curr_c, next_c)
    if next_c == curr_c:
        mugen = True
    if next_c == 1:
        no_loop_count = 0
        loop_cnt = i + 1
        break
    elif rireki[next_c] == 0:
        rireki[next_c] = i+1
    else:
        # print(next_c)
        no_loop_count = rireki[next_c] -1
        loop_cnt = i - no_loop_count
        break
    curr_c = next_c

if loop_cnt ==0:
    loop_cnt = 1


# if mugen


# if not mugen:
if k <= no_loop_count or loop_cnt == 0:
    ans = rireki.index(k)
else:
    # print('k',k)
    # print('no', no_loop_count)
    # print('lo', loop_cnt)
    ind = (k-1-no_loop_count)%loop_cnt +1
    rireki_fix = [i-no_loop_count for i in rireki]
    # print(ind, 'ind')
    ans = rireki_fix.index(ind)
    # print(rireki_fix)
    print(ans)

### FIXED CODE ###

def main():
    n, k = map(int, input().split()) 
    al = list(map(int, input().split())) 
    city_l = [1]
    city_s = set([1])
    loop_city_l = []
    curr_city = 1
    cnt = 0
    for i in range(1,k+1):
        next_c = al[curr_city-1]
        if next_c in city_s:
            cnt = i
            first_city = city_l.index(next_c)
            loop_city_l = city_l[first_city:]
            break
        else:
            city_s.add(next_c)
            city_l.append(next_c)
        curr_city = next_c
    else:
        print(curr_city)
        return

    # print(loop_city_l)
    remained = k-cnt
    last_pos = remained%len(loop_city_l)
    print(loop_city_l[last_pos])

if __name__ == "__main__":
    main()
N = int(input())

import math
i=0
prime = []
while 2**i<math.sqrt(N):
    j = 0
    while 2**i*5**j < math.sqrt(N):
        prime.append(2**i*5**j)
        j += 1
    i += 1
prime = sorted(prime)

cnt = 0
ret = []
m = N//(prime[cnt])
while m>0:
    if N//m==N%m:
        ret.append(m)
#         print(m,N//m, N%m)
        cnt += 1
        if len(prime) > cnt:
            while N//(prime[cnt]) > m:
                cnt += 1
            m = N//(prime[cnt])-1
#             print(m)
        else:
            m = 0
    else:
        m-=1
        
sum(ret)

### FIXED CODE ###

N = int(input())
val = []
max_len = [2,4]
def comb(val, max_len, depth=0):
    if depth==len(max_len):
        yield val
        return 

    for i in range(max_len[depth]+1):
        yield from comb(val+[i], max_len, depth+1)
# for it in comb(val, max_len):
# #     print('a')
#     print(it)


import math
def primeFactor(num):
    prime = {}
    x = 2
    MAX =  math.sqrt(num)+1
    while x <MAX:
        if num%x==0:
            if x in prime:
                prime[x] += 1
            else:
                prime[x]=1
            num //= x
        else:
            x += 1
    if num != 1:
        prime[num]=1
    return prime

divisor = primeFactor(N)


ans = 0
val = []
for it in comb(val, list(divisor.values())):
    total = 1
    for i, j in zip(list(divisor.keys()), it):
    #     print(i, j)
        total *= i**j
#     print(total)
    
    m = total - 1
    if m < 1:
        continue
    if N%m==N//m:
#         print('{0} mod {1} = {2}, {0}/{1} = {3}'.format(N, m, N%m, N//m))
        ans += m
        
print(ans)
X, Y, A, B, C = map(int, input().split())
p = list(map(int, input().split())) + [-1]
q = list(map(int, input().split())) + [-1]
r = list(map(int, input().split())) + [-1]
p.sort()
q.sort()
r.sort()

summ = 0
Z = 0
while X + Y - Z:
    if r[-1] * (C - Z > 0) < p[-1] * (X > 0) > q[-1] * (Y > 0):
        summ += p.pop()
        X -= 1
    elif p[-1] * (X > 0) < q[-1] * (Y > 0) > r[-1] * (C - Z > 0):
        summ += q.pop()
        Y -= 1
    else:
        summ += r.pop()
        Z += 1

print(summ)

### FIXED CODE ###

X, Y, A, B, C = map(int, input().split())
p = list(map(int, input().split()))
q = list(map(int, input().split()))
r = list(map(int, input().split()))
p.sort()
q.sort()
r.sort()
p = p[-X:]
q = q[-Y:]
r.extend(p)
r.extend(q)
r.sort()
print(sum(r[-(X + Y):]))
n = int(input())
A = list(map(int,input().split()))

def factorization(n):
    arr = []
    temp = n
    for i in range(2, int(-(-n**0.5//1))+1):
        if temp%i==0:
            cnt=0
            while temp%i==0:
                cnt+=1
                temp //= i
            arr.append([i, cnt])

    if temp!=1:
        arr.append([temp, 1])

    if arr==[]:
        arr.append([n, 1])

    return arr

def gcd(a, b):
    while b:
        a, b = b, a % b
    return a

pc = True

fac = [0]*(10**3+1)
for a in A:
    lst = factorization(a)
    for p in lst:
        if not fac[p[0]]:
            fac[p[0]] = 1
        else:
            pc = False
            break
    if not pc:
        break
if pc:
    print('pairwise coprime')
else:
    g = A[0]
    for i in range(1,n):
        g = gcd(g, A[i])
    if g == 1:
        print('setwise coprime')
    else:
        print('not coprime')

### FIXED CODE ###

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

def factorize(n):
    fct = []  # prime factor
    b, e = 2, 0  # base, exponent
    while b * b <= n:
        while n % b == 0:
            n = n // b
            e = e + 1
        if e > 0:
            fct.append((b, e))
        b, e = b + 1, 0
    if n > 1:
        fct.append((n, 1))
    return fct

def gcd(a, b):
    while b:
        a, b = b, a % b
    return a

pc = True

fac = [0]*(10**6+1)
for a in A:
    lst = factorize(a)
    for p in lst:
        if not fac[p[0]]:
            fac[p[0]] = 1
        else:
            pc = False
            break
    if not pc:
        break
if pc:
    print('pairwise coprime')
else:
    g = A[0]
    for i in range(1,n):
        g = gcd(g, A[i])
    if g == 1:
        print('setwise coprime')
    else:
        print('not coprime')
x = list(input().split)
print(x[1]*x[2], 2*(x[1]+x[2]))

### FIXED CODE ###

x = input().split(" ")
a = int(x[0])
b = int(x[1])
s = a*b
l = 2*(a+b)
print(s, l)
s = input()
t = input()
numlist = []
for i in range(len(s)-len(t)):
    a = s[i:i+len(t)]
    count = 0
    for j in range(len(t)):
        if a[j] != t[j]:
            count += 1
    numlist.append(count)
print(min(numlist))

### FIXED CODE ###

s = input()
t = input()
numlist = []
for i in range(len(s)-len(t)+1):
    a = s[i:i+len(t)]
    count = 0
    for j in range(len(t)):
        if a[j] != t[j]:
            count += 1
    numlist.append(count)
print(min(numlist))
S = input("先週のコンテスト名を入力")

a = ABC

b = ARC

if S == a:
  print(b)
  
else:
  print(a)

### FIXED CODE ###

S = input()

if S == "ABC":
  print("ARC")
  
else:
  print("ABC")
n = int(input())
l = [1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51]
print(l[n+1])

### FIXED CODE ###

l = [1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51]
n = int(input())
print(l[n-1])
import math

n = int(input())
a = [int(i) for i in input().split()]
m = []
if len(a) == 2:
    print(max(a))

else:
    for i in range(n-1):
        m.append(math.gcd(a[i],a[i+1]))
    m.append(math.gcd(a[0],a[n-1]))
    m = list(set(m))
    m.sort()
    print(m[1])


### FIXED CODE ###

from fractions import gcd

n = int(input())
a = [int(i) for i in input().split()]
l,r = [0],[0]
for i in range(1,n):
    l.append(gcd(l[i-1],a[i-1]))
    r.append(gcd(r[i-1],a[-i]))
r = r[::-1]
ans = 0

for i in range(n):
    ans = max(ans,gcd(l[i],r[i]))
print(ans)
n = input()

color = [0 for i in range(n)]
d = [0 for i in range(n)]
f = [0 for i in range(n)]
M = [0 for i in range(n)]0 for j in range(n)]

def dfs_v(u):
  color[u] = 1
  t += 1
  d[u] = t
  for v in range(n):
    if M[u][v] == 1 and color[v] == 0:
      dfs_v(v)
  color[u] = 2
  t += 1
  f[u] = t

def dfs():
  t = 0
  for u in range(n):
    if color[u] == 0:
      dfs_v(u)
  for u in range(n):
    print u+1, d[u], f[u]

for i in range(n):
  X = map(int, raw_input().split())
  for j in range(X[1]):
   M[X[0]-1] [X[2+j]-1] = 1

dfs()
    

### FIXED CODE ###

n = int(raw_input())
 
d = [0 for i in range(n)]
f = [0 for i in range(n)]
G = [0 for i in range(n)]
M = [[0 for i in range(n)] for j in range(n)]
col = [0 for i in range(n)]
t = [0]
 
def DFS_visit(u):
    col[u] = 1
    t[0] += 1
    d[u] = t[0]
    for v in range(n):
        if M[u][v] == 1 and col[v] == 0:
            DFS_visit(v)
    col[u] = 2
    t[0] += 1
    f[u] = t[0]
 
def DFS():
    for u in range(n):
        if col[u] == 0:
            DFS_visit(u)
    for u in range(n):
        print'{0} {1} {2}'.format(u+1, d[u], f[u])
     
for i in range(n):
    X = map(int, raw_input().split())
    for j in range(X[1]):
        M[X[0]-1][X[2+j]-1] = 1
 
DFS()
num1,num2 = map(int,input(),split())

 
num3 = num1 + num2
num4 = num1 - num2
num5 = num1 * num2
num6 = [num3, num4, num5]
 
print(max(num6))

### FIXED CODE ###

num1,num2 = map(int,input().split())
 
num3 = num1 + num2
num4 = num1 - num2
num5 = num1 * num2
num6 = [num3, num4, num5]
 
print(max(num6))
from collections import deque
import copy
H, W = map(int, input().split())
A = tuple(tuple(input()) for _ in range(H))
L=[[0]*W for _ in range(W)]
next_q=deque()

for i in range(H):
    for j in range(W):
        if A[i][j]=='#':
            L[i][j]=1
            next_q.append((i,j))

q=deque()

res = 0
while len(next_q) != 0:
    q=copy.copy(next_q)
    next_q.clear()
    while q:
        y, x = q.popleft()
        if y > 0 and L[y - 1][x] == 0:
            L[y - 1][x] = 1
            next_q.append((y - 1, x))
        if y < H - 1 and L[y + 1][x] == 0:
            L[y + 1][x] = 1
            next_q.append((y + 1, x))
        if x > 0 and L[y][x - 1] == 0:
            L[y][x - 1] = 1
            next_q.append((y, x - 1))
        if x < W - 1 and L[y][x + 1] == 0:
            L[y][x + 1] = 1
            next_q.append((y, x + 1))
    if len(next_q)==0: break
    res += 1
print(res)


### FIXED CODE ###

from collections import deque
import copy
H, W = map(int, input().split())
A = tuple(tuple(input()) for _ in range(H))
L=[[0]*W for _ in range(H)]
next_q=deque()

for i in range(H):
    for j in range(W):
        if A[i][j]=='#':
            L[i][j]=1
            next_q.append((i,j))

q=deque()

res = 0
while len(next_q) != 0:
    q=copy.copy(next_q)
    next_q.clear()
    while q:
        y, x = q.popleft()
        if y > 0 and L[y - 1][x] == 0:
            L[y - 1][x] = 1
            next_q.append((y - 1, x))
        if y < H - 1 and L[y + 1][x] == 0:
            L[y + 1][x] = 1
            next_q.append((y + 1, x))
        if x > 0 and L[y][x - 1] == 0:
            L[y][x - 1] = 1
            next_q.append((y, x - 1))
        if x < W - 1 and L[y][x + 1] == 0:
            L[y][x + 1] = 1
            next_q.append((y, x + 1))
    if len(next_q)==0: break
    res += 1
print(res)
a,b,c = int(input().split())
z = [int(input().split())]
if a == 1:
  sco = abs(z-c)
else:
  if abs(z[-1] - c) > abs(z[-2] - z[-1]):
    sco = abs(z[-1] - c)
  else:
    sco = abs(z[-2] - z[-1])
    
print(sco)

### FIXED CODE ###

a,b,c = map(int, input().split())
z = [int(_) for _ in input().split()]
if a == 1:
  sco = abs(z[0]-c)
else:
  if abs(z[-1] - c) > abs(z[-2] - z[-1]):
    sco = abs(z[-1] - c)
  else:
    sco = abs(z[-2] - z[-1])
    
print(sco)
s=input()
k=int(input())
for i in range(len(s)):
    if s[i]!="1":
        num=i
        ans=s[i]
        break
if k<=num:
    print(1)
else:
    print(ans)


### FIXED CODE ###

s=input()
k=int(input())
ans=1
num=1000
for i in range(len(s)):
    if s[i]!="1":
        num=i
        ans=s[i]
        break
if k<=num:
    print(1)
else:
    print(ans)
p = input()
if p % 10 == 9:
  print ("Yes")
else:
  print("No")


### FIXED CODE ###

p = int(input())
if p % 10 == 9 or 90 <= p <= 99:
    print ("Yes")
else:
    print ("No")