Harryxun/stf_run huggingface dataset:
from collections import defaultdict
import bisect

n = int(input())
s = input()
S = []
cnt_ch = defaultdict(list)
for i in range(n):
    S.append(s[i])
    cnt_ch[s[i]].append(i)
    
    
    
    
q = int(input())
for i in range(q):
    qw = input()
    if qw[0] == "1":
        qw = qw[2:]
        i, ch = map(str, qw.split())
        if S[int(i) - 1] == ch:
            continue
        S[int(i) - 1] = ch
        remove = bisect.bisect_left(cnt_ch[S[int(i) - 1]], int(i) - 1)
        del cnt_ch[S[int(i) - 1]][remove]
        if not cnt_ch[ch]:
            cnt_ch[ch].append(int(i) - 1)
            continue
        bisect.insort_left(cnt_ch[ch], int(i) - 1)
        
        
    else:
        #print(cnt_ch)
        qw = qw[2:]
        l, r = map(int, qw.split())
        cnt = 0
        for i in range(ord("a"),ord("a") + 26):
            if not cnt_ch[chr(i)]:
                continue
            edge = bisect.bisect_left(cnt_ch[chr(i)], l - 1)
            #print(cnt_ch[chr(i)][edge - 1:])
            #if bisect.bisect_left(cnt_ch[chr(i)][edge:], i) < r:
            #print(cnt_ch[chr(i)])
            #print(l, r)
            #print(edge)
            if edge < len(cnt_ch[chr(i)]):
                if cnt_ch[chr(i)][edge] < r:
                    cnt += 1
            #print(cnt, "cnt", chr(i))
        print(cnt)
        
        


### FIXED CODE ###

from collections import defaultdict
import bisect

n = int(input())
s = input()
S = []
cnt_ch = defaultdict(list)
for i in range(n):
    S.append(s[i])
    cnt_ch[s[i]].append(i)
    
    
    
    
q = int(input())
for i in range(q):
    qw = input()
    if qw[0] == "1":
        qw = qw[2:]
        i, ch = map(str, qw.split())
        if S[int(i) - 1] == ch:
            continue
        remove = bisect.bisect_left(cnt_ch[S[int(i) - 1]], int(i) - 1)
        del cnt_ch[S[int(i) - 1]][remove]
        S[int(i) - 1] = ch
        if not cnt_ch[ch]:
            cnt_ch[ch].append(int(i) - 1)
            continue
        bisect.insort_left(cnt_ch[ch], int(i) - 1)
        
        
    else:
        #print(cnt_ch)
        qw = qw[2:]
        l, r = map(int, qw.split())
        cnt = 0
        for i in range(ord("a"),ord("a") + 26):
            if not cnt_ch[chr(i)]:
                continue
            edge = bisect.bisect_left(cnt_ch[chr(i)], l - 1)
            #print(cnt_ch[chr(i)][edge - 1:])
            #if bisect.bisect_left(cnt_ch[chr(i)][edge:], i) < r:
            #print(cnt_ch[chr(i)])
            #print(l, r)
            #print(edge)
            if edge < len(cnt_ch[chr(i)]):
                if cnt_ch[chr(i)][edge] < r:
                    cnt += 1
            #print(cnt, "cnt", chr(i))
        print(cnt)
N,K = map(int, input().split())

min = 10**18+1
flag = True

while flag==True:
  N = abs(N-K)
  if N < min: min = N
  else: flag = False
    
return min


### FIXED CODE ###

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

A,B = B,A
A,C = C,A

print(A,B,C)
from scipy.special import comb

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

for i in range(1, k+1):
    if n-k+1 < i:
        print(0)
    else:
        print(int((comb(n-k+1, i, exact=True) * comb(k-1, i-1, exact=True)) % (10**9 + 7)))


### FIXED CODE ###

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

    mod = 10 ** 9 + 7
    fact = [1]
    for i in range(1, 2001):
        fact.append(fact[-1] * i)

    def comb(l, r):
        return fact[l] // fact[r] // fact[l - r]

    for i in range(1, k + 1):
        print((comb(n - k + 1, i) * comb(k - 1, i - 1)) % mod)


if __name__ == "__main__":
    main()
import numpy as np

h, w, a, b = list(map(int, input().split()))

nmod = 10**9+7
board = np.zeros((h+1, w+1), dtype=int)
board[1,1] = 1

for x in range(1, h+1):
    for y in range(1, w+1):
        if x >= h-a+1 and y <= b:
            continue
        board[x,y] += board[x-1,y] + board[x,y-1]
        if board[x,y] >= nmod:
            board[x,y] = board[x,y] % nmod
print(board[h,w])

### FIXED CODE ###

# -*- coding: utf-8 -*-
"""
Created on Mon Sep 23 17:33:45 2019
ABC042D
@author: maezawa
"""

MAX = 5*10**5+1
MOD = 10**9+7

fac = [0] * MAX
finv = [0]*MAX
inv = [0]*MAX

# テーブルを作る前処理
fac[0] = 1
fac[1] = 1
finv[0] = 1
finv[1] = 1
inv[1] = 1
for i in range(2,MAX):
    fac[i] = fac[i - 1] * i % MOD
    inv[i] = MOD - inv[MOD%i] * (MOD // i) % MOD
    finv[i] = finv[i - 1] * inv[i] % MOD

# 二項係数計算
def COM(n, k):
    if (n < k):
        return 0
    if (n < 0 or k < 0):
        return 0
    return fac[n] * (finv[k] * finv[n - k] % MOD) % MOD

def HCOM(n,k):
    return COM(n+k-1,k)


#n, r = list(map(int, input().split()))
#ans = COM(n, r)
#print(ans)

h, w, a, b = list(map(int, input().split()))
cnt = 0
for i in range(h-a):
    p0 = HCOM(b, i) * HCOM(w-b,h-i-1)
    cnt = (cnt+p0)%MOD
print(cnt)
h, w, n = map(int,input().split())
cell = [[0]*w for _ in range(h)]
for _ in range(n):
    a, b = map(int,input().split())
    cell[a-1][b-1] = 1

ans = [0]*10

for i in range(h-2):
    for j in range(w-2):
        s = [cell[i][j],cell[i+1][j],cell[i+2][j],cell[i][j+1],cell[i+1][j+1],cell[i+2][j+1],cell[i][j+2],cell[i+1][j+2],cell[i+2][j+2]].count(1)
        ans[s] += 1

for i in ans:
    print(i)

### FIXED CODE ###

h, w, n = map(int,input().split())
 
xy_pos = dict()
 
for i in range(n):
    a, b = map(int, input().split())
    for k in range(-2,1):
        for l in range(-2,1):
            x = (a-1) + k
            y = (b-1) + l
            if (0 <= x <= h-3 and 0 <= y <= w-3):
                xy = str(x) + "x" + str(y)
                if xy in xy_pos:
                    xy_pos[xy] += 1
                else:
                    xy_pos[xy] = 1
 
ans = [0]*10                    
for v in xy_pos.values():
    ans[v] += 1
ans[0] = (h-2)*(w-2) - sum(ans)
for i in range(10):
    print(ans[i])
a = int(input())
b = int(input())
 for i in range(1, 4):
    if a != i and b != i:
        print(i)

### FIXED CODE ###

a = int(input())
b = int(input())
for i in range(1, 4):
  if a!=i and b!=i:
    print(i)
import sys
sys.setrecursionlimit(10**7)

def input():
    return sys.stdin.readline()[:-1]

def dfs(now, parent, total):
    result[now] = total + counter[now]
    for child in tree[now]:
        if child == parent:
            continue
        dfs(child, result[now])

        
N, Q = map(int, input().split())
edge = [list(map(int, input().split())) for _ in range(N-1)]
P = [list(map(int, input().split())) for _ in range(Q)]

tree = [[] for _ in range(N+1)]
counter = [0 for _ in range(N+1)]

for a,b in edge:
    tree[a].append(b)
    tree[b].append(a)

for p,x in P:
    counter[p] += x

result = [0]*(N+1)
dfs(1, 0, 0)

print(' '.join(map(str, result[1:])))

### FIXED CODE ###

import sys
sys.setrecursionlimit(10**7)

def input():
    return sys.stdin.readline()[:-1]

def dfs(now, parent, total):
    result[now] = total + counter[now]
    for child in tree[now]:
        if child == parent:
            continue
        dfs(child, now, result[now])

N, Q = map(int, input().split())
edge = [list(map(int, input().split())) for _ in range(N-1)]
P = [list(map(int, input().split())) for _ in range(Q)]

tree = [[] for _ in range(N+1)]
counter = [0 for _ in range(N+1)]

for a,b in edge:
    tree[a].append(b)
    tree[b].append(a)

for p,x in P:
    counter[p] += x

result = [0]*(N+1)
dfs(1, 0, 0)

print(' '.join(map(str, result[1:])))
h,w=map(int,input().split())

A=[]
for i in range(h):
    A.append(list(map(int,input().split())))

C=[]
ha=0
s=1
a=0
b=0
for i in range(h*w):
    if A[a][b]%2==1 :
        ha=(ha+1)%2
    if ha==1:
        if b+s<w and b+s>=0 :
            C.append([a,b,a,b+s])
        elif a<h :
            C.append([a,b,a+1,b])
    if ha==0 :
        aa=len(C)

    if b+s<w and b+s>=0 :
        b+=s
    else:
        a+=1
        s = -s

        
print(aa)

for i in range(aa):
    print(str(C[i][0]+1)+" "+str(C[i][1]+1)+" "+str(C[i][2]+1)+" "+str(C[i][3]+1))
    


### FIXED CODE ###

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

A=[]
for i in range(h):
    A.append(list(map(int,input().split())))

if h==1 and w==1 :
    print(0)
else:


    aa=0
    C=[]
    ha=0
    s=1
    a=0
    b=0
    for i in range(h*w):
        if A[a][b]%2==1 :
            ha=(ha+1)%2
        if ha==1:
            if b+s<w and b+s>=0 :
                C.append([a,b,a,b+s])
            elif a<h :
                C.append([a,b,a+1,b])
        if ha==0 :
            aa=len(C)

        if b+s<w and b+s>=0 :
            b+=s
        else:
            a+=1
            s = -s

            
    print(aa)

    for i in range(aa):
        print(str(C[i][0]+1)+" "+str(C[i][1]+1)+" "+str(C[i][2]+1)+" "+str(C[i][3]+1))
import sys
input = sys.stdin.readline
import bisect
MOD = 998244353
n = int(input())
XD = sorted([list(map(int, input().split())) for _ in range(n)])
X, D = zip(*XD)


C = list(range(n))

class RmaxQ:
    def __init__(self, original):
        self.n = len(original)
        self.INF = -float("inf")
        self.N0 = 1 << (self.n-1).bit_length()
        self.seg = [self.INF]*(self.N0 << 1)
        for i, j in enumerate(original, self.N0):
            self.seg[i] = j
        for i in range(self.N0-1, 0, -1):
            self.seg[i] = max(self.seg[2*i], self.seg[2*i+1])

    def get(self, i):
        return self.seg[i+self.N0]
        
    def update(self, i, x):
        i += self.N0
        self.seg[i] = x
        while i > 1:
            i >>= 1
            self.seg[i] = max(self.seg[2*i], self.seg[2*i+1])
                
    def query(self, l, r):
        res = self.INF
        l += self.N0
        r += self.N0
        while l < r:
            if r & 1:
                res = max(res, self.seg[r-1])
            if l & 1:
                res = max(res, self.seg[l])
                l += 1
            l >>= 1
            r >>= 1
     
        return res
    
seg = RmaxQ(C)
for i in range(n):
  x, d = XD[n-1-i]
  t = bisect.bisect_left(X, x+d
  seg.update(n-1-i, max(t, seg.query(n-1-i, t)))

dp = [0]*(n+1)
l = [0]*n
l[-1] = n
dp[-1] = 1
for i in range(n):
  x, d = XD[n-1-i]
  m = bisect.bisect_left(X, x+d)
  t = seg.query(n-1-i, m)
  dp[n-1-i] = dp[n-i] + dp[t]
  dp[n-1-i] %= MOD
print(dp[0])

### FIXED CODE ###

import sys
input = sys.stdin.readline
import bisect
MOD = 998244353
n = int(input())
XD = sorted([list(map(int, input().split())) for _ in range(n)])
X, D = zip(*XD)


C = list(range(n))

class RmaxQ:
    def __init__(self, original):
        self.n = len(original)
        self.INF = -float("inf")
        self.N0 = 1 << (self.n-1).bit_length()
        self.seg = [self.INF]*(self.N0 << 1)
        for i, j in enumerate(original, self.N0):
            self.seg[i] = j
        for i in range(self.N0-1, 0, -1):
            self.seg[i] = max(self.seg[2*i], self.seg[2*i+1])

    def get(self, i):
        return self.seg[i+self.N0]
        
    def update(self, i, x):
        i += self.N0
        self.seg[i] = x
        while i > 1:
            i >>= 1
            self.seg[i] = max(self.seg[2*i], self.seg[2*i+1])
                
    def query(self, l, r):
        res = self.INF
        l += self.N0
        r += self.N0
        while l < r:
            if r & 1:
                res = max(res, self.seg[r-1])
            if l & 1:
                res = max(res, self.seg[l])
                l += 1
            l >>= 1
            r >>= 1
     
        return res
    
seg = RmaxQ(C)
for i in range(n):
  x, d = XD[n-1-i]
  t = bisect.bisect_left(X, x+d)
  seg.update(n-1-i, max(t, seg.query(n-1-i, t)))

dp = [0]*(n+1)
l = [0]*n
l[-1] = n
dp[-1] = 1
for i in range(n):
  x, d = XD[n-1-i]
  m = bisect.bisect_left(X, x+d)
  t = seg.query(n-1-i, m)
  dp[n-1-i] = dp[n-i] + dp[t]
  dp[n-1-i] %= MOD
print(dp[0])
_, K = map(int, input())
a = list(map(int, input().split()))
s = [sum([b > c for c in a]) for b in a]
l = [sum([l < a[i] for l in a[:i]]) for i in range(1, len(a))]
l.insert(0, 0)
r = [b - c for b, c in zip(s, l)]
a = (sum(r)*(1+K) + sum(l)*(K-1))*K/2
print(int(a%(1e9+7)))


### FIXED CODE ###

MAX = 10**9 + 7
_, K = map(int, input().split())
a = list(map(int, input().split()))
s = [sum([b > c for c in a]) for b in a]
r = [sum([b > c for c in a[i:]]) for i, b in enumerate(a)]
b = sum(s)*(K-1)*K//2%MAX
print((b+sum(r)*K)%MAX)
#A
"""
a,b = map(int, input().split())
if b % a == 0:
    print(b + a)
else:
    print(b-a)
"""

#B
"""
n, m = map(int, input().split())
ans = input().split()
del ans[0]
for i in range(n-1):
    a = input().split()
    del a[0]
    for k in ans:
        if k in a:
            continue
        else:
            ans.remove(k)
print(len(ans))
"""

#C
import math
n = int(input())
a = list(map(int, input().split()))
x = a[0]
for i in range(n):
    x = math.gcd(x, a[i])
print(x) 

### FIXED CODE ###

#A
"""
a,b = map(int, input().split())
if b % a == 0:
    print(b + a)
else:
    print(b-a)
"""

#B
"""
n, m = map(int, input().split())
ans = input().split()
del ans[0]
for i in range(n-1):
    a = input().split()
    del a[0]
    for k in ans:
        if k in a:
            continue
        else:
            ans.remove(k)
    if len(ans) == 0:
        break
print(len(ans))
"""
#C
import fractions
from functools import reduce

def gcd(*numbers):
    return reduce(fractions.gcd, numbers)

def gcd_list(numbers):
    return reduce(fractions.gcd, numbers)

n = int(input())
a = list(map(int, input().split()))
print(gcd_list(a))
from collections import deque
import sys

def fnw(n,s):
    sm=deque([])
    if n<=len(s):
        for _ in range(n):
            sm.append(s.popleft())
    return ''.join(sm)

def jfws(s):
    fws=fnw(5,s)
    print(fws)
    if fws=='dream':
        fws=fnw(2,s)
        if fws=='er':
            if s[0]=='a':
                s.extendleft(deque(reversed(list(fws))))
        else:
            s.extendleft(deque(reversed(list(fws))))
        return False
    elif fws=='erase':
        fws=fnw(1,s)
        if fws!='r':
            s.appendleft(fws)
        return False
    else:
        return True 

def main(s):
    while s:
        if jfws(s):
            return 'NO'
    return 'YES'

s=deque(sys.stdin.readline().strip())
print(main(s))



### FIXED CODE ###

from collections import deque
import sys

def fnw(n,s):
    sm=deque([])
    if n<=len(s):
        for _ in range(n):
            sm.append(s.popleft())
    return sm

def jfws(s):
    # print(s)
    sm=fnw(5,s)
    # print(sm)
    if ''.join(sm)=='dream':
        sm=fnw(2,s)
        if ''.join(sm)=='er':
            if bool(s):
                if s[0]=='a':
                    s.extendleft(deque(reversed(list(sm))))
        else:
            s.extendleft(deque(reversed(list(sm))))
        return False
    elif ''.join(sm)=='erase':
        sm=fnw(1,s)
        if ''.join(sm)!='r':
            s.extendleft(sm)
        return False
    else:
        return True 

def main(s):
    while len(s)>0:
        if jfws(s):
            return 'NO'
    return 'YES'

s=deque(sys.stdin.readline().strip())
print(main(s))
abcd = int(input())
d = abcd % 10
c = int(((abcd - d) % 100)/10)
b = (abcd - c*10 - d)%1000
a = int(abcd / 1000)

s = "Good"
if(a == b){
  s = "Bad"
}
if(b = c){
  s = "Bad"
}
if(c == d){
  s = "Bad"
}

print(s)

### FIXED CODE ###

abcd = int(input())
d = int(abcd % 10)
c = int(((abcd - d) % 100)/10)
b = int((abcd - c*10 - d)%1000/100)
a = int(abcd / 1000)

if(a == b):
  print("Bad")
elif(b == c):
  print("Bad")
elif(c == d):
  print("Bad")
else:
  print("Good")
N=int(input())
A=list(map(int,input().split()))

A_set=set(A)
A_lst=list(A_set)

# すべてが0のとき
if sum(A_set)==0 and len(A_set)==1:
    print('Yes')
    exit()

# x…2N/3,0…N/3
if len(A_set)==2 and A_set.count(0)==1 t and A_set.count(sum(A_set)//2)==2 and len(A)%3==0:
    print('Yes')
    exit()

# x^y^z==0
if len(A_set)==3 and A_lst[0]^A_lst[1]^A_lst[2]==0 and len(A)%3==0:
    print('Yes')
    exit()

# それ以外
print('No')

### FIXED CODE ###

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

A_set=set(A)
A_lst=list(A_set)

# すべてが0のとき
if sum(A_set)==0 and len(A_set)==1:
    print('Yes')
    exit()

# x…2N/3,0…N/3
if len(A_set)==2 and A_lst.count(0)==1 and len(A)%3==0:
    cnt=0
    for i in range(N):
        if A[i]==0:
            cnt+=1
    if cnt==N//3:
        print('Yes')
    else:
        print('No')
    exit()

# x^y^z==0
if len(A_set)==3 and A_lst[0]^A_lst[1]^A_lst[2]==0 and len(A)%3==0:
    cnt_x,cnt_y,cnt_z=0,0,0
    x,y,z=A_lst[0],A_lst[1],A_lst[2]
    for i in range(N):
        if A[i]==x:
            cnt_x+=1
            continue
        if A[i]==y:
            cnt_y+=1
            continue
        if A[i]==z:
            cnt_z+=1
    if cnt_x==cnt_y==cnt_z:
        print('Yes')
    else:
        print('No')
    exit()

# それ以外
print('No')
S=input()
if S[5:7]<5:
    print('Heisei')
else:
    print('TBD')
    

### FIXED CODE ###

S=input()
if int(S[5:7])<5:
    print('Heisei')
else:
    print('TBD')
N,A,B,C=map(int,input().split(' '))
S = [input() for i in range(N)]
ans = []
if A+B+C==0:
    print('No')
else:
    d = {"A":A,"B":B,"C":C}
    for n,i in enumerate(S):
        l,r=list(i)
        L,R=d[l],d[r]
        if L==R==0:
            print('No')
            print(ans)
            exit()
        elif L==0:
            ans.append(l)
            d[l] +=1
            d[r] -=1
        elif R==0:
            d[l] -=1
            d[r] +=1
            ans.append(r)
        elif L==R==1 and n != N-1 and i != S[n+1]:
            if l in S[n+1]:
                d[l] +=1
                d[r] -=1
                ans.append(l)
            else:
                d[l] -=1
                d[r] +=1
                ans.apppend(r)
        else:
            if L>=R:
                d[l] -=1
                d[r] +=1
                ans.append(r)
            else:
                d[l] +=1
                d[r] -=1
                ans.append(l)
print('Yes')
for i in ans:
    print(i)

### FIXED CODE ###

N,A,B,C=map(int,input().split(' '))
S = [input() for i in range(N)]
ans = []
if A+B+C==0:
    print('No')
else:
    d = {"A":A,"B":B,"C":C}
    for n,i in enumerate(S):
        l,r=list(i)
        L,R=d[l],d[r]
        if L==R==0:
            print('No')
            exit()
        elif L==0:
            ans.append(l)
            d[l] +=1
            d[r] -=1
        elif R==0:
            d[l] -=1
            d[r] +=1
            ans.append(r)
        elif L==R==1 and n != N-1 and i != S[n+1]:
            if l in S[n+1]:
                d[l] +=1
                d[r] -=1
                ans.append(l)
            else:
                d[l] -=1
                d[r] +=1
                ans.append(r)
        else:
            if L>=R:
                d[l] -=1
                d[r] +=1
                ans.append(r)
            else:
                d[l] +=1
                d[r] -=1
                ans.append(l)
    print('Yes')
    for i in ans:
        print(i)
s = input()
s.sort()
print('Yes' if s == 'abc' else 'No')

### FIXED CODE ###

s = list(input())
s.sort()
print('Yes' if ''.join(s) == 'abc' else 'No')
d,t,s=map(int,input().split())

if d//s > t:
  print('No')
else:
  print('Yes'

### FIXED CODE ###

d,t,s=map(int,input().split())

if d/s > t:
  print('No')
else:
  print('Yes')
ABC = list(map(int,input().split()))
K = int(input())
print(max(ABC) * 2**K + sum(ABC) - max(ABC))

### FIXED CODE ###

m,d = map(int, input().split())
if (m <= d):
    print(m)
else:
    print(m-1)
#!usr/bin/env python3
from collections import defaultdict, deque, Counter
from heapq import heappush, heappop
from itertools import permutations
import sys
import math
import bisect

def LI(): return [int(x) for x in sys.stdin.readline().split()]


def I(): return int(sys.stdin.readline())


def LS(): return [list(x) for x in sys.stdin.readline().split()]


def S():
    res = list(sys.stdin.readline())
    if res[-1] == "\n":
        return res[:-1]
    return res


def IR(n):
    return [I() for i in range(n)]


def LIR(n):
    return [LI() for i in range(n)]


def SR(n):
    return [S() for i in range(n)]


def LSR(n):
    return [LS() for i in range(n)]


sys.setrecursionlimit(1000000)
mod = 1000000007


def solve():
    n, k = LI()
    flag_list = [False] * n
    for _ in range(k-1):
        d = I()
        a = LIR(max(d-1, 1))
        for i in range(d):
            flag_list[a[0][i]-1] = True
    print(flag_list.count(False))
    
    return


if __name__ == "__main__":
    solve()


### FIXED CODE ###

#!usr/bin/env python3
from collections import defaultdict, deque, Counter
from heapq import heappush, heappop
from itertools import permutations
import sys
import math
import bisect

def LI(): return [int(x) for x in sys.stdin.readline().split()]


def I(): return int(sys.stdin.readline())


def LS(): return [list(x) for x in sys.stdin.readline().split()]


def S():
    res = list(sys.stdin.readline())
    if res[-1] == "\n":
        return res[:-1]
    return res


def IR(n):
    return [I() for i in range(n)]


def LIR(n):
    return [LI() for i in range(n)]


def SR(n):
    return [S() for i in range(n)]


def LSR(n):
    return [LS() for i in range(n)]


sys.setrecursionlimit(1000000)
mod = 1000000007


def solve():
    n, k = LI()
    flag_list = [False] * n
    for _ in range(k):
        d = I()
        a = LI()
        for i in range(d):
            flag_list[a[i]-1] = True
    print(flag_list.count(False))
    
    return


if __name__ == "__main__":
    solve()
X = int(input())
If X =< 30:
print ('Yes')
else:
print('No')

### FIXED CODE ###

X= int(input())
if X >= 30:
 print("Yes")
else:
 print("No")
# -*- coding: utf-8 -*-
A,B,C=map(int,input().split())
S =set("ABC")
T =set("557")
if S & T = ("5","5","7"):
  print("YES")
else:
  print("NO")

### FIXED CODE ###

# -*- coding: utf-8 -*-
A,B,C = map(str,input().split())
S = A+B+C
if S.count("5") ==2 and S.count("7") == 1:
  print("YES")
else:
  print("NO")
N = int(input())
mylist = []
for i in range (N):
  A = int(input())
  mylist.append(int(A))
my = sorted(mylist,reverse=True)
del my[2:]
for j in range (N):
  if mylist[j] == my[0]:
    print(my[1])
  else:
    print(my[0])

### FIXED CODE ###

r = int(input())
print(3* (r**2))
import sys

def euc(n,m):
    if n == m:
        return m
    elif m == 1 | n == 1:
        return 1
    else:
        return euc(min(n,m), max(n,m)-min(n,m))

for line in sys.stdin:
    a,b = [int(i) for i in line.split()]
    print(euc(a,b),int(a*b/euc(a,b)))



### FIXED CODE ###

import sys


def euc(n,m):
    if max(n,m)%min(n,m) == 0:
        return min(n,m)
    else:
        return euc(min(n,m), max(n,m)%min(n,m))


for line in sys.stdin:
    a,b = [int(i) for i in line.split()]
    print(euc(a,b),int(a*b/euc(a,b)))
N,L = map(int, input().split())
list = []
sum = 0
min = 10000
sign = 1
for i in range(1,N+1):
    sum += L+i-1
    list.append(L+i-1)
for num in list:
    if min > abs(num):
        min = abs(num)
        if num > 0:
            sign = 1
        else:
            sign = -1
print(sum-min*sign)


### FIXED CODE ###

M = input()
S = list(M)

result = "Good"
for str in S:
    if M.count(str+str) > 0:
        result = "Bad"
        break
print(result)
a=int(input())
b=int(input())
c=int(input())
d=int(input())
e=int(input())
k=int(input())

if d-a<=k
  print('Yay!')
else:
  print(':(')

### FIXED CODE ###

a=int(input())
b=int(input())
c=int(input())
d=int(input())
e=int(input())
k=int(input())
 
if e-a<=k:
  print('Yay!')
else:
  print(':(')
inpl = lambda: list(map(int,input().split()))
N, M, X, Y = inpl()
x = inpl()
y = inpl()

x.append(X)
y.append(Y)
xmax = max(X)
ymin = min(Y)
if xmax < ymin:
  print('No War')
else:
  print('War')

### FIXED CODE ###

inpl = lambda: list(map(int,input().split()))
N, M, X, Y = inpl()
x = inpl()
y = inpl()
 
x.append(X)
y.append(Y)
xmax = max(x)
ymin = min(y)
if xmax < ymin:
  print('No War')
else:
  print('War')