Harryxun/stf_run huggingface dataset:
import sys
from subprocess import Popen, PIPE
from itertools import groupby
from collections import Counter

def main():
    sys.stdin.readline()
    S = sys.stdin.read()
    T = []
    inv_dict = {}
    Factors = Popen("factor " + S, stdout=PIPE).communicate()[0].split(b"\n")
    for factors in Factors:
        factors = map(int, factors.split()[1:])
        t = 1
        t_inv = 1
        for f, group in groupby(factors):
            n = len(list(group)) % 3
            if n == 1:
                t *= f
            elif n == 2:
                t_inv *= f
        t, t_inv = t * t_inv * t_inv, t * t * t_inv
        T.append(t)
        inv_dict[t] = t_inv

    counter_T = Counter(T)
    ans = 0
    for t, t_cnt in counter_T.items():
        if t == 1:
            ans += 1
            continue
        t_inv = inv_dict[t]
        t_inv_cnt = counter_T[t_inv]
        if t_cnt > t_inv_cnt or (t_cnt == t_inv_cnt and t > t_inv):
            ans += t_cnt
    print(ans)

main()


### FIXED CODE ###

import sys
from collections import Counter

def make_prime_checker(n):
    # nまでの自然数が素数かどうかを表すリストを返す  O(nloglogn)
    is_prime = [False, True, False, False, False, True] * (n//6+1)
    del is_prime[n+1:]
    is_prime[1:4] = False, True, True
    for i in range(5, int(n**0.5)+1):
        if is_prime[i]:
            is_prime[i*i::i] = [False] * (n//i-i+1)
    return is_prime

def main():
    Primes = [p for p, is_p in enumerate(make_prime_checker(2200)) if is_p]
    def decomp(n):
        res1 = res2 = 1
        for p in Primes:
            cnt = 0
            while n % p == 0:
                n //= p
                cnt += 1
            cnt %= 3
            if cnt == 1:
                res1 *= p
            elif cnt == 2:
                res2 *= p
        if int(n**0.5)**2 == n:
            res2 *= int(n**0.5)
        else:
            res1 *= n
        return res1 * res2 * res2, res1 * res1 * res2

    N, *S = map(int, sys.stdin.buffer.read().split())
    T = []
    inv_dict = {}
    for s in S:
        t, t_inv = decomp(s)
        T.append(t)
        inv_dict[t] = t_inv

    counter_T = Counter(T)
    ans = 0
    for t, t_cnt in counter_T.items():
        if t == 1:
            ans += 1
            continue
        t_inv = inv_dict[t]
        t_inv_cnt = counter_T[t_inv]
        if t_cnt > t_inv_cnt or (t_cnt == t_inv_cnt and t > t_inv):
            ans += t_cnt
    print(ans)

main()
th,td,ah,ad = map(int,input().split())
x,y = (td+ah-1)//td,(ad+th-1)//ad
if(x<=y):print("Yes")
else:print("No")


### FIXED CODE ###

s,w = map(int,input().split())
if(w>=s):print("unsafe")
else:print("safe")
import numpy as np

n = int(input())
v = [int(_) for _ in input().split()]

if n == 2:
    if v[0] == v[1]:
        print(1)
    else:
        print(0)
else:
    m = int(n / 2)
    p = max(v)

    evens = np.array([0] * p)
    odds = np.array([0] * p)

    for i in range(0, m):
        evens[v[2 * i] - 1] += 1
        odds[v[2 * i + 1] - 1] += 1
    
    mode_e2, mode_e1 = evens.argsort()[-2:]
    mode_o2, mode_o1 = odds.argsort()[-2:]

    if mode_e1 == mode_o1:
        if evens[mode_e1] > odds[mode_o1]:
            print(n - evens[mode_e1] - odds[mode_o2])
        else:
            print(n - evens[mode_e2] - odds[mode_o1])
    else:
        print(n - evens[mode_e1] - odds[mode_o1])

### FIXED CODE ###

import numpy as np

n = int(input())
v = [int(_) for _ in input().split()]

m = int(n / 2)
p = max(v)

evens = np.array([0] * p)
odds = np.array([0] * p)

for i in range(0, m):
    evens[v[2 * i] - 1] += 1
    odds[v[2 * i + 1] - 1] += 1

if len(evens) == 1 and len(odds) == 1:
    if evens.argsort()[-1] == odds.argsort()[-1]:
        print(m)
    else:
        print(0)
elif len(evens) ==1:
    mode_e1 = evens.argsort()[-1]
    mode_o2, mode_o1 = odds.argsort()[-2:]
    if mode_e1 == mode_o1:
        print(m - odds[mode_o2])
    else:
        print(m - odds[mode_o1])
elif len(odds) == 1:
    mode_e2, mode_e1 = evens.argsort()[-2:]
    mode_o1 = odds.argsort()[-1]
    if mode_e1 == mode_o1:
        print(m - evens[mode_e2])
    else:
        print(m - evens[mode_e1])
else:
    mode_e2, mode_e1 = evens.argsort()[-2:]
    mode_o2, mode_o1 = odds.argsort()[-2:]

    if mode_e1 == mode_o1:
        print(min(n - evens[mode_e1] - odds[mode_o2], n - evens[mode_e2] - odds[mode_o1]))
    else:
        print(n - evens[mode_e1] - odds[mode_o1])
import math

N,D=int(input().split())

if N%(2*D+1)==0:
    print(N//(2*D+1))
else:
    print((N//(2*D+1))+1)

### FIXED CODE ###

import math

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

if N%(2*D+1)==0:
    print(N//(2*D+1))
else:
    print((N//(2*D+1))+1)
n,x = tuple(map(int,input().split()))
a = tuple(map(int,input().split()))
a = sorted(a,reverse=True)

t = a.pop()
ans = 0
while x>=t:
  ans+=1
  x-=t
  t=a.pop()
  
print(ans)

### FIXED CODE ###

n,x = tuple(map(int,input().split()))
a = tuple(map(int,input().split()))
a = sorted(a)
ans=0

for a_i in a:
  x -= a_i
  if x<0:
    break
  else:
    ans+=1

if x>0:
  ans-=1

print(ans)
N,Q = map(int,input().split())
ablist = [[] for _ in range(N)]
anslist = [0 for i in range(N)]

for i in range(N-1):
    a,b = map(int,input().split())
    ablist[a-1].append(b-1)
    ablist[b-1].append(a-1)

pxlist = [list(map(int,input().split())) for _ in range(Q)]

for q,x in pxlist:
    anslist[q-1] += x

def dfs(nownode,oya=-1):
    for nextnode in ablist[nownode]:
        if oya == nextnode:
            continue
        anslist[nextnode] += anslist[nownode]
        dfs(nextnode,nownode)
dfs(0,-1)
print(*anslist)

### FIXED CODE ###

import sys
input = sys.stdin.readline
sys.setrecursionlimit(10 ** 7)
 

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

T = [[]for i in range(N)]

for i in range(N-1):
    a, b = map(int, input().split())
    T[a-1].append(b-1)
    T[b-1].append(a-1)

X = [0 for i in range(N)]
for i in range(Q):
    p, x = map(int, input().split())
    X[p-1] += x

# def dfs(x, p):
#     for j in T[x]:
#         if j == p:
#             continue
#         X[j] += X[x]
#         dfs(j, x)
def dfs(nownode,oya=-1):
    for nextnode in T[nownode]:
        if oya == nextnode:
            continue
        X[nextnode] += X[nownode]
        dfs(nextnode,nownode)

dfs(0, -1)

print(*X)
n, T = map(int, input().split())
a = []
min_ = 1001
for i in range(n):
    c, t = map(int, input().split())
    a.append(c)
    if t <= T and a[i] <= min_:
        min_ = a[i]
if min_ == 1001:
    print('TLE')
else:
    print(min_)

### FIXED CODE ###

n = int(input())
if n == 1:
    print('Hello World')
else:
    a = int(input())
    b = int(input())
    print(a + b)
n,m = map(int,input().split())
ab = [[int(i) for i in input().split()] for j in range(m)]

im_b = [0]*(n)

for i in range(n):
    im_b[ab[i][0]-1] += 1
    im_b[ab[i][1]-1] -= 1

if im_b[0] % 2 == 1:
    print('NO')
    exit()

#im_a = [0]*(n)
#im_a[0] = im_b[0]

for i in range(n-1):
    #print(i)
    if im_b[i] % 2 == 1:
        print('NO')
        exit()

print('YES')

### FIXED CODE ###

n,m = map(int,input().split())
ab = [[int(i) for i in input().split()] for j in range(m)]

im_b = [0]*(n)

for i in range(m):
    im_b[ab[i][0]-1] += 1
    im_b[ab[i][1]-1] -= 1

if im_b[0] % 2 == 1:
    print('NO')
    exit()

#im_a = [0]*(n)
#im_a[0] = im_b[0]

for i in range(n-1):
    #print(i)
    if im_b[i] % 2 == 1:
        print('NO')
        exit()

print('YES')
W = input().rstrip()
text = ""
while True:
    line = input().rstrip()
    if line == "END_OF_TEXTS":
        break
    text += line
print(text.count(W))


### FIXED CODE ###

W = input().rstrip()
lst = []
while True:
    line = input().rstrip()
    if line == "END_OF_TEXT":
        break
    lst += line.lower().split()
print(lst.count(W))
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)
    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 True:
        if jfws(s):
            return 'NO'
        if not bool(s):
            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))
import math

K = int(input())
ans = 0

for i in range(1,K+1):
  for j in range(1,K+1):
    ab = math.gcd(a, b)
    for k in range(1,K+1):
      ans += math.gcd(ab, c)

print(ans)

### FIXED CODE ###

import math

K = int(input())
ans = 0

for i in range(1,K+1):
  for j in range(1,K+1):
    ij = math.gcd(i, j)
    for k in range(1,K+1):
      ans += math.gcd(ij, k)

print(ans)
N=int(input())
S=input().split()
for i in range(0,N):
    s=int(S[i])
    if 1<=s<=399:
        S[i]="a"
    if 400<=s<=799:
        S[i]="b"
    if 800<=s<=1199:
        S[i]="c"
    if 1200<=s<=1599:
        S[i]="d"
    if 1600<=s<=1999:
        S[i]="e"
    if 2000<=s<=2399:
        S[i]="f"
    if 2400<=s<=2799:
        S[i]="g"
    if 2800<=s<=3199:
        S[i]="h"
    if 3200<=s:
        S[i]="i"

if "i" in S:
    i=S.count("i")
    B=len(set(S))
    if B=1:
        C=N
        D=N
    else:
        C=B-1
        D=C+i
    
else:
    C=len(set(S))
    D=C

print(C,D)

### FIXED CODE ###

N=int(input())
S=input().split()
for i in range(0,N):
    s=int(S[i])
    if 1<=s<=399:
        S[i]="a"
    if 400<=s<=799:
        S[i]="b"
    if 800<=s<=1199:
        S[i]="c"
    if 1200<=s<=1599:
        S[i]="d"
    if 1600<=s<=1999:
        S[i]="e"
    if 2000<=s<=2399:
        S[i]="f"
    if 2400<=s<=2799:
        S[i]="g"
    if 2800<=s<=3199:
        S[i]="h"
    if 3200<=s:
        S[i]="i"

if "i" in S:
    i=S.count("i")
    B=len(set(S))
    if B==1:
        C=1
        D=N
    else:
        C=B-1
        D=C+i
    
else:
    C=len(set(S))
    D=C

print(C,D)
A = [int(_) for _ in input().split()]

if sum(A) >= 22:
    print('bust')
else:
    print('win'

### FIXED CODE ###

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

if sum(A) >= 22:
    print('bust')
else:
    print('win')
a = input()
b = a.split()
N = int(b[0])
S = list(b[1])
K = int(b[2])
lit = S[K-1]
for i in range(N):
  if S[i] != lit:
    S[i] = '*'

print(''.join(S))

### FIXED CODE ###

N = int(input())
S = list(input())
K = int(input())
lit = S[K-1]
for i in range(N):
  if S[i] != lit:
    S[i] = '*'

print(''.join(S))
N = int(input())

nodes = []
edges = []

for i in range(N):
    nodes.append([])


for i in range(N-1):
    a, b = [int(v) for v in input().split()]
    a -= 1
    b -= 1

    nodes[a].append((b, i))
    nodes[b].append((a, i))

max_l = 0
max_i = 0
for i, links in enumerate(nodes):
    l = len(links)
    if max_l < l:
        max_l = l
        max_i = i


def fill(nodes, links, e, pc):
    c = 1
    if c == pc:
        c += 1
    for n, i in links:
        if e[i] != 0:
            continue
        e[i] = c
        fill(nodes, nodes[n], e, c)

        c += 1
        if c == pc:
            c += 1
    
e = [0] * (N - 1)
fill(nodes, nodes[max_i], e, 0)

print(max_l)
for i in e:
    print(i)

### FIXED CODE ###

N = int(input())

nodes = []
edge = []
for i in range(N):
    nodes.append([])

for i in range(N-1):
    a, b = [int(v) - 1 for v in input().split(' ')]
    if a >= len(nodes):
        exit()
    if b >= len(nodes):
        exit()
    nodes[a].append((b, i))
    nodes[b].append((a, i))
    edge.append(0)

max_l = 0
max_i = 0
if nodes is None:
    exit()

for i, links in enumerate(nodes):
    if links is None:
        exit()
    l = len(links)
    if max_l < l:
        max_l = l
        max_i = i

def fill(nodes, edge, queue):
    while len(queue) > 0:
        ni, pc = queue.pop(0)
        links = nodes[ni]

        c = 1
        if pc == c:
            c += 1

        if links is None:
            exit()

        next_links = []
        for n, i in links:
            if n < 0 or i < 0:
                exit()
            if n >= len(nodes) or i >= len(edge):
                exit()

            if edge[i] != 0:
                continue
            edge[i] = c
            queue.append((n, c))

            c += 1
            if pc == c:
                c += 1

queue = [(max_i, 0)]    
fill(nodes, edge, queue)

print(max_l)
for e in edge:
    print(e)
N, K = list(map(int, input().split()))
P = list(map(lambda x: int(x) - 1, input().split()))
C = list(map(int, input().split()))

ans = -10**9-1
for i in range(N):
    seen = [-1]*N
    cumsum = [0]*(N+1)
    now = i
    j = 0
    while seen[now] == -1:
        seen[now] = 1
        now = P[now]
        cumsum[j+1] = cumsum[j] + C[now]
        j += 1
    loop_size = j
    if K <= loop_size:
        ans = max([ans] + cumsum[1:K+1])
    else:
        if cumsum[loop_size] > 0:
            loop_n = K//loop_size
            score = cumsum[loop_size]*loop_n + max(cumsum[1:K%loop_size+1])
            ans = max(ans, score)
        else:
            ans = max([ans] + cumsum[1:loop_size+1])
print(ans)

### FIXED CODE ###

N, K = list(map(int, input().split()))
P = list(map(lambda x: int(x) - 1, input().split()))
C = list(map(int, input().split()))
ans = -10**9-1
for i in range(N):
    cumsum = [0]*(N+1)
    seen = [-1]*N
    K_ = K
    now = i
    j = 0
    while K_ > 0 and seen[now] == -1:
        seen[now] = 1
        now = P[now]
        cumsum[j+1] = cumsum[j] + C[now]
        K_ -= 1
        j += 1
    if K_ == 0:
        ans = max(ans, max(cumsum[1:j+1]))
    else:
        if cumsum[j] > 0:
            loop_size = j
            loop_n = K//loop_size - 1
            tmp = loop_n*cumsum[loop_size]
            tmp += max(max(cumsum[1:loop_size+1]), cumsum[loop_size] + max(cumsum[0:K_%loop_size+1]))
            ans = max(ans, tmp)
        else:
            ans = max(ans, max(cumsum[1:j+1]))
print(ans)
# coding: utf-8
# Your code here!
n=input().split(" ")
for i in range(3):
  n[i]=int(n[i])
ans=(n[2]-(n[1]-n[0])
if ans <0:
	print(0)
else:
     print(ans)
     


### FIXED CODE ###

# coding: utf-8
# Your code here!
n=input().split(" ")
for i in range(3):
  n[i]=int(n[i])
ans=(n[2]-(n[0]-n[1]))
if ans < 0:
	print(0)
else:
     print(ans)
a = gets.to_i
for num in 1..a
    if num.to_s =~ /3/ || num % 3 == 0
        print " #{num}"
    end
end
puts

### FIXED CODE ###

n=input()
print "",
for i in xrange(1,n+1):
    if i%3==0 or '3' in str(i):
        print i,
K, S = map(int,input().split())
count = 0
for x in range(0,K+1,1):
  for y in range(0,K+1,1):
    z = S - x - y
    print(x,y,z)
    if x+y+z == S and z <= K and z >= 0:
      count += 1
print(count)

### FIXED CODE ###

s = str(input())
s=s.replace(","," ")
print(s)
#C
import sys
from math import gcd
n=int(input())
a=list(map(int,input().split()))
if len(a)==2:
    print(max(a))
    sys.exit()
g=gcd(a[0],a[1])
b=[]
for i in range(2,n):
    l=gcd(g,a[i])
    if l!=g:
        b.append(i)
        g=l
s=[]
g=gcd(a[0],a[2])
for i in range(3,n):
    g=gcd(g,a[i])
s.append(g)
g=gcd(a[1],a[2])
for i in range(3,n):
    g=gcd(g,a[i])
s.append(g)
for i in range(len(b)):
    g=gcd(a[0],a[1])
    for j in range(2,n):
        if j==b[i]:
            continue
        g=gcd(g,a[j])
    s.append(g)
print(max(s))

### FIXED CODE ###

#C
import sys
from fractions import gcd
n=int(input())
a=list(map(int,input().split()))
if len(a)==2:
    print(max(a))
    sys.exit()
g=gcd(a[0],a[1])
b=[]
for i in range(2,n):
    l=gcd(g,a[i])
    if l!=g:
        b.append(i)
        g=l
s=[]
g=gcd(a[0],a[2])
for i in range(3,n):
    g=gcd(g,a[i])
s.append(g)
g=gcd(a[1],a[2])
for i in range(3,n):
    g=gcd(g,a[i])
s.append(g)
for i in range(len(b)):
    g=gcd(a[0],a[1])
    for j in range(2,n):
        if j==b[i]:
            continue
        g=gcd(g,a[j])
    s.append(g)
print(max(s))
h,w,m = map(int,input().split())
hw = [list(map(int,input().split())) for i in range(m)]
hb = [0 for i in range(h)]
wb = [0 for j in range(w)]
M = [[0 for i in range(w)] for j in range(h)]

for i in range(m):
    hb[hw[i][0]-1] += 1
    wb[hw[i][1]-1] += 1
    M[hw[i][0]-1][hw[i][1]-1] = -1

max_h = max(hb)
max_w = max(wb)
ans = max_h + max_w

max_h_list = []
for i in range(h):
    if hb[i] == max_h:
        max_h_list.append(i)
max_w_list = []
for i in range(h):
    if wb[i] == max_w:
        max_w_list.append(i)

count = 0
flg = 0
for i in range(len(max_h_list)):
    for j in range(len(max_w_list)):
        if M[max_h_list[i]][max_w_list[j]] == -1:
            count += 1
        else:
            flg = 1
            break
    if flg == 1:
        break
if count == len(max_h_list) * len(max_w_list):
    ans -= 1

print(ans)

### FIXED CODE ###

h,w,m = map(int,input().split())
hw = [list(map(int,input().split())) for i in range(m)]
hb = [0] * h
wb = [0] * w

for i in range(m):
    hb[hw[i][0]-1] += 1
    wb[hw[i][1]-1] += 1

max_h = max(hb)
max_w = max(wb)
ans = max_h + max_w
count = hb.count(max_h) * wb.count(max_w)
for i in range(m):
    if hb[hw[i][0]-1] == max_h and wb[hw[i][1]-1] == max_w:
        count -= 1
if count <= 0:
    ans -= 1
print(ans)
A, B = map(int, input().split)
print(max(A+B, A-B, A*B))

### FIXED CODE ###

A, B = map(int, input().split())
print(max(A+B, A-B, A*B))
def abs_result(x,y):
    tmp = abs(x-y)
    return tmp

def main():
    line = list(map(int,input().split()))
    n,k = line[0],line[1]
    
    # nを、nとkの差の絶対値で置き換える
    if n == 0 or k == 1:
        print(0)
        return
    
    if n % 2 == 0 k % 2 == 0 and n < k:
        print(2)
    
    if n % 2 == 0 k % 2 == 0 and n > k:
        print(0)
        
    if n % 2 == 1 and k % 2 == 0 and n > k:
        print(1)
        
    
    com = 2
    for i in range(0,10**18):
        ans = abs_result(n,k)
        if ans == 0:
            print(0)
            return
        elif ans == 1:
            print(1)
            return
        if ans <= com:
            print(ans)
            return
        n = ans

main()

### FIXED CODE ###

def main():
    n,k = map(int,input().split())
    t = n % k
    x = k - t
    if t < x:
        print(t)
    else:
        print(x)
main()
#欠片は３Aに加えPもあるから３A+Pだ
import math
A=int(inport())
P=int(inport())

pai=(3*A+P)/2
print(math.floor(pai))

### FIXED CODE ###

A,P= map(int, input().split())
print((3*A+P)//2)
S = input()
count = 0
c = []
for i in range(len(S)):
    if S[i] == "A" or S[i] == "C" or S[i] == "G" or S[i] == "T":
        count += 1
    else:
        c.append(count)
        count = 0
print(max(c))

### FIXED CODE ###

S = input()
count = 0
c = [0]
for i in range(len(S)):
    if S[i] == "A" or S[i] == "C" or S[i] == "G" or S[i] == "T":
        count += 1
    else:
        c.append(count)
        count = 0
c.append(count)
print(max(c))
N=int(input())
X=N/1.08
if int(X*1.08)!=N:
    print(":(")
elif:
    ((int(X)+1)*1.08)==N:
        print(int(X)+1)
else:
    print(int(X))

### FIXED CODE ###

N=int(input())
X=int(N/1.08)
C=[X-1,X,X+1]
for c in C:
    d=int(c*1.08)
    if d==N:
        print(c)
        break
else:
    print(":(")
input1 = input()
Kbai= int(input1)
 
input2=input().split(" ")
maxs= int(input2[0])
mins= int(input2[1])
flg=0
ans=0
 
while ans < maxs:
  ans=ans+kbai
  if ans >= mins and ans <= maxs:
    flg=1
 
if flg ==1:
  print("OK")
else:
  print("NG")

### FIXED CODE ###

#
#at coder beginner contest165 a we love golf
#
import math

input1 = input()
kbai= int(input1)
 
input2=input().split(" ")
mins= int(input2[0])
maxs= int(input2[1])
flg=0
ans=0
tmp=0

tmp=math.floor(mins/kbai)
ans=tmp*kbai
#print(tmp)

while ans <= maxs:
  if ans >= mins and ans <= maxs:
    flg=1
  ans=ans+kbai

if flg ==1:
  print("OK")
  #print(ans,maxs,mins,flg)
else:
  print("NG")
  #print(ans,maxs,mins,flg)
aw = 0
for i in map(int, input().split()):
    if i == 1:
        s+=300000
    elif i ==2 :
        s+= 200000
    elif i ==3 :
        s+= 100000
if aw== 600000:
    aw= 1000000
print(aw)

### FIXED CODE ###

aw = 0
for i in map(int, input().split()):
    if i == 1:
        aw+=300000
    elif i ==2 :
        aw+= 200000
    elif i ==3 :
        aw+= 100000
if aw== 600000:
    aw= 1000000
print(aw)
n, x = map(int, input().split())
l = list(map(int, input().split()))
d = [0]
for li in l:
  d.append(d[-1] + li)
print(len([di for di in d if d <= x]))


### FIXED CODE ###

n, x = map(int, input().split())
l = list(map(int, input().split()))
d = [0]
for li in l:
  d.append(d[-1] + li)
print(len([di for di in d if di <= x]))
S = list(map(int,input().split()))
L = list(map(int,input().split()))
n = 0
for i in range(3):
  if S[i] == L[i]:
    n += 1
print(n)

### FIXED CODE ###

S = input()
L = input()
n = 0
for i in range(3):
  if S[i] == L[i]:
    n += 1
print(n)
import sys

n = int(input())
minv = int(input())
maxv = -1000000000

for r in map(int,sys.stdin.readlines()):
  if maxv < r-minv < 0:
    maxv = r-minv
    minv = r
  elif maxv < r-minv:
    maxv = r-minv
  elif m < 0:
    minv = r

print(maxv)

### FIXED CODE ###

import sys
 
l = sys.stdin.readlines()
minv = int(l[1])
maxv = -1000000000

for r in map(int,l[2:]):
  m = r-minv
  if maxv < m: 
    maxv = m
    if m < 0: minv = r
  elif m < 0: minv = r
 
print(maxv)
S = input()
dp = [[0 for i in range(4)] for i in range(len(S)+1)]
MOD = 10**9+7
dp[0][3] = 1
for i in range(len(S)):
    if S[i] == '?': k = 3
    else: k = 1
    for _ in range(k):
      for l in range(4)
        dp[i+1][l] += dp[i][l] 
    if S[i] == 'A':
        dp[i+1][0] +=  dp[i][3]
    elif S[i] == 'B':
        dp[i+1][1] +=  dp[i][0]
    elif S[i] == 'C':
        dp[i+1][2] += dp[i][1]
    else:
        dp[i+1][0] += dp[i][3]
        dp[i+1][1] += dp[i][0]
        dp[i+1][2] += dp[i][1]
    for j in range(4):
        if dp[i][j] > MOD: dp[i][j] %= MOD
print(dp[len(S)][2]%MOD)


### FIXED CODE ###

S = input()
dp = [[0 for i in range(4)] for i in range(len(S)+1)]
MOD = 10**9+7
dp[0][3] = 1
for i in range(len(S)):
    if S[i] == '?': k = 3
    else: k = 1
    for _ in range(k):
        dp[i+1][0] += dp[i][0] 
        dp[i+1][1] += dp[i][1] 
        dp[i+1][2] += dp[i][2] 
        dp[i+1][3] += dp[i][3] 
    if S[i] == 'A':
        dp[i+1][0] +=  dp[i][3]
    elif S[i] == 'B':
        dp[i+1][1] +=  dp[i][0]
    elif S[i] == 'C':
        dp[i+1][2] += dp[i][1]
    else:
        dp[i+1][0] += dp[i][3]
        dp[i+1][1] += dp[i][0]
        dp[i+1][2] += dp[i][1]
    for j in range(4):
        if dp[1+i][j] > MOD: dp[i+1][j] %= MOD
print(dp[len(S)][2]%MOD)
a = input()
s = a % 10
print("hon" if s ==2 or s == 4 or s == 5 or 
      s == 7 or s == 9 else "pon" if 
      s == 0 or s == 1 or s == 6 or s == 8
      else "bon")

### FIXED CODE ###

a = int(input())
s = a % 10
print("hon" if s ==2 or s == 4 or s == 5 or 
      s == 7 or s == 9 else "pon" if 
      s == 0 or s == 1 or s == 6 or s == 8
      else "bon")
W, H, x, y, r = map(int, raw_input().split())

if r <= x and x <= W - r:
 if r <= y and y <= H - r:
  print "Yes"
 else:
 print "No"

else:
 print "No"

### FIXED CODE ###

W, H, x, y, r = map(int, raw_input().split())

if x < r or x + r > W or y < r or y + r >H :
  print "No"
else:
 print "Yes"