Harryxun/stf_run huggingface dataset:
class Queue(object):

    def __init__(self):
        self.queue_list = []

    def enqueue(self, value):
        self.queue_list.append(value)

    def dequeue(self):
        try:
            # 先頭をとりだす
            value = self.queue_list.pop(0)
        except IndexError:
            value = None

        return value
N = int(input())

pair = []
tree = {}

for _ in range(N-1):
    a, b = list(map(int, input().split(" "))) 
    if a in tree.keys():
        tree[a].append(b)
    else:
        tree[a] = [b]
        
    if b in tree.keys():
        tree[b].append(a)
    else:
        tree[b] = [a]
    pair.append([a,b])
    
c = list(map(int, input().split(" ")))
c.sort(reverse=True)
c = c[:N+2]

queue = Queue()
tree_l = {}
for key in tree.keys():
    tree_l[key] = len(tree[key])

ans = {}
max_node = max((v, k) for k, v in tree_l.items())[1]
ans[max_node] = c[0]
used = [max_node]
cnt = 0

candi = {}
for i in tree[max_node]:
    candi[i] = tree_l[i]

for k, v in sorted(candi.items(), key=lambda x: -x[1]):
    queue.enqueue(k)

while True:
    node = queue.dequeue()
    cnt += 1
    ans[node] = c[cnt]
    
    if cnt == N-1:
        break
    
    candi = {}
    for i in tree[node]:
        candi[i] = tree_l[i]
    for k, v in sorted(candi.items(), key=lambda x: -x[1]):
        if k not in used:
            queue.enqueue(k)

            
total = 0
for a, b in pair:
    if ans[a] > ans[b]:
        total += ans[b]
    else:
        total += ans[a]
        
print(total)
for i in range(1, N, 1):
    print(ans[i], end=" ")

print(ans[N])



### FIXED CODE ###

class Queue(object):

    def __init__(self):
        self.queue_list = []

    def enqueue(self, value):
        self.queue_list.append(value)

    def dequeue(self):
        try:
            # 先頭をとりだす
            value = self.queue_list.pop(0)
        except IndexError:
            value = None

        return value
N = int(input())

pair = []
tree = {}

for _ in range(N-1):
    a, b = list(map(int, input().split(" "))) 
    if a in tree.keys():
        tree[a].append(b)
    else:
        tree[a] = [b]
        
    if b in tree.keys():
        tree[b].append(a)
    else:
        tree[b] = [a]
    pair.append([a,b])
    
c = list(map(int, input().split(" ")))
c.sort(reverse=True)
c = c[:N+2]


queue = Queue()
tree_l = {}
for key in tree.keys():
    tree_l[key] = len(tree[key])

ans = {}
max_node = max((v, k) for k, v in tree_l.items())[1]
ans[max_node] = c[0]
used = [max_node]
cnt = 0

candi = {}
for i in tree[max_node]:
    candi[i] = tree_l[i]

for k, v in sorted(candi.items(), key=lambda x: -x[1]):
    queue.enqueue(k)
    used.append(k)

while True:
    node = queue.dequeue()
    cnt += 1
    ans[node] = c[cnt]
    
    if cnt == N-1:
        break
    
    candi = {}
    for i in tree[node]:
        candi[i] = tree_l[i]
    for k, v in sorted(candi.items(), key=lambda x: -x[1]):
        if k not in used:
            queue.enqueue(k)
            used.append(k)
total = 0
for a, b in pair:
    if ans[a] > ans[b]:
        total += ans[b]
    else:
        total += ans[a]
        
print(total)
for i in range(1, N, 1):
    print(ans[i], end=" ")

print(ans[N])
a,b,c,x=map(int,input().split())
ans=0
for p in range(a+1):
    for q in range(b+1):
        for r in range(c+1):
            if 500*p+100*q+50*r==x: ans+=1
print(ans)

### FIXED CODE ###

a=int(input())
b=int(input())
c=int(input())
x=int(input())
ans=0
for p in range(a+1):
    for q in range(b+1):
        for r in range(c+1):
            if 500*p+100*q+50*r==x: ans+=1
print(ans)
s=input()
while(1):
  s=s[:-2]
  l=len(s)
  if s[:l/2]==s[l/2:]:
    print(l)
    break


### FIXED CODE ###

s=input()
while 1:
  s=s[:-2]
  l=len(s)
  if s[:l//2]==s[l//2:]:
    print(l)
    break
import collections
n = int(input())
v = list(map(int, input().split()))

count = 0
v1 = []
v2 = []
while count < n:
  v1.append(v[count])
  v2.append(v[count + 1])
  count += 2

c1 = collections.Counter(v1)
c2 = collections.Counter(v2)

num1, count1 = c1.most_common()[0]
num2, count2 = c2.most_common()[0]

if num1 != num2:
  min_count = (n // 2 - count1) + (n // 2 - count2)
elif count1 == count2 and count1 == n // 2:
  min_count = (n // 2)
else:
  if count1 == count2:
    for i in range(min(len(c1.most_common()), c2.most_common())):
        a = i + 1
        if c1.most_common()[a][a] == c2.most_common()[a][a]:
            continue
        if c1.most_common()[a][a] > c2.most_common()[a][a]:
            num2, count2 = c2.most_common()[a]
            break
        else:
            num1, count1 = c1.most_common()[a]
            break
    min_count = (n // 2 - count1) + (n // 2 - count2)
  else:
    if len(c1.most_common()) > 1 and len(c2.most_common()):
      num3, count3 = c1.most_common()[1]
      num4, count4 = c2.most_common()[1]
      a = (n // 2 - count1) + (n // 2 -count4)
      b = (n // 2 - count2) + (n // 2 -count3)
      min_count = min(a,b)
    else:
      if count1 > count2:
        num2, count2 = c2.most_common()[1]
        min_count = (n // 2 - count1) + (n // 2 - count2)
      else:
        num1, count1 = c1.most_common()[1]
        min_count = (n // 2 - count2) + (n // 2 - count1)
print(min_count)

### FIXED CODE ###

import collections
n = int(input())
v = list(map(int, input().split()))

count = 0
v1 = []
v2 = []
while count < n:
  v1.append(v[count])
  v2.append(v[count + 1])
  count += 2

c1 = collections.Counter(v1)
c2 = collections.Counter(v2)

num1, count1 = c1.most_common()[0]
num2, count2 = c2.most_common()[0]

if num1 != num2:
  min_count = (n // 2 - count1) + (n // 2 - count2)
elif count1 == count2 and count1 == n // 2:
  min_count = (n // 2)
else:
  if len(c1.most_common()) > 1 and len(c2.most_common()):
    num3, count3 = c1.most_common()[1]
    num4, count4 = c2.most_common()[1]
    a = (n // 2 - count1) + (n // 2 -count4)
    b = (n // 2 - count2) + (n // 2 -count3)
    min_count = min(a,b)
  else:
    if count1 > count2:
      num2, count2 = c2.most_common()[1]
      min_count = (n // 2 - count1) + (n // 2 - count2)
    else:
      num1, count1 = c1.most_common()[1]
      min_count = (n // 2 - count2) + (n // 2 - count1)
print(min_count)
num = input()
print(3 * num * num) 

### FIXED CODE ###

num = int(input())
print(3 * num * num)
n = int(input())
a = input().split()

for i in range(len(a)):
    a[i] = int(a[i])

x = 0
y = 0

operations = []

for i in range(n-2):
    a_sorted = sorted(a)
    x = a_sorted[0]
    y = a_sorted[1]

    a.remove(x)
    a.remove(y)
    a.append(x-y)
    operations.append(str(x) + " " + str(y))
a_sorted = sorted(a)
a_sorted_reverse = sorted(a_sorted, reverse=True)
x = a_sorted_reverse[0]
a_sorted_reverse.remove(x)
a_sorted = sorted(a_sorted_reverse)
y = a_sorted[0]
operations.append(str(x) + " " + str(y))


a.remove(x)
if y in a:
    a.remove(y)
a.append(x-y)

print(sorted(a, reverse=True)[0])
for i in operations:
    print(i)


### FIXED CODE ###


input_data = input()
n,  k = input_data.split()

n = int(n)
k = int(k)

i  = n - k
max = i + 1
min = 1

if k == 1:
    print(0)
else:
    print(max - min)
n=int(input())
x_=input()
px=x_.count("1")
if not px:
    for i in range(n):
        print(1)
    exit()
if px==1:
#https://atcoder.jp/contests/aising2020/submissions/15163004
    for i in range(n):
        if X[i]=="1":
            cur=i
            break
    for i in range(n):
        if i==cur:
            print(0)
    else:
        if i==n-1 or cur==n-1:
            print(2)
        else:
            print(1)
    # for i in range(n):
    #     if int(x_[-i-1]):
    #         print(0)
    #     else:
    #         if not i or int(x_[-1])==1:###
    #             print(2)
    #         else:
    #             print(1)
    exit()
x=int(x_,2)

pow2=[1]

for i in range(n):
    tmp=pow2[-1]
    tmp*=2
    tmp%=px+1
    pow2.append(tmp)
pow22=[1]
for i in range(n):
    tmp=pow22[-1]
    tmp*=2
    tmp%=px-1
    pow22.append(tmp)
x1=x%(px+1)
x2=x%(px-1)
ans=[]
for i in range(n):
    tmp=0;dv=0
    if int(x_[-i-1]):
        tmp=x2-pow22[i]
        tmp%=(px-1)
        dv=px-1
    else:
        tmp=x1+pow2[i]
        tmp%=(px+1)
        dv=px+1
    
    cnt=1
    while tmp:
        
        dv=bin(tmp).count("1")
        if not dv or not tmp:
            break
        
        tmp%=dv
        cnt+=1
    ans.append(cnt)
for i in ans[::-1]:
    print(i)


### FIXED CODE ###

n=int(input())
x_=input()
px=x_.count("1")
if not px:
    for i in range(n):
        print(1)
    exit()
if px==1:
####[上から] i 桁目
    for i in range(n):
        if int(x_[i]):
            print(0)
        else:
            if i==n-1 or int(x_[-1])==1:###
                print(2)
            else:
                print(1)
    exit()
x=int(x_,2)

pow2=[1]

for i in range(n):
    tmp=pow2[-1]
    tmp*=2
    tmp%=px+1
    pow2.append(tmp)
pow22=[1]
for i in range(n):
    tmp=pow22[-1]
    tmp*=2
    tmp%=px-1
    pow22.append(tmp)
x1=x%(px+1)
x2=x%(px-1)
ans=[]
for i in range(n):
    tmp=0;dv=0
    if int(x_[-i-1]):
        tmp=x2-pow22[i]
        tmp%=(px-1)
        dv=px-1
    else:
        tmp=x1+pow2[i]
        tmp%=(px+1)
        dv=px+1
    
    cnt=1
    while tmp:
        
        dv=bin(tmp).count("1")
        if not dv or not tmp:
            break
        
        tmp%=dv
        cnt+=1
    ans.append(cnt)
for i in ans[::-1]:
    print(i)
def main():
    n,m = map(int,input().split())
    job =[[] for _ in range(m)]
    for i in range(n):
        a,b=map(int,input().split())
        if a-1 < m:
            job[a-1].append(-B) # b:asc, -b:desc
    
    res = 0
    q = 0
    from heapq import heappop, heappush
    for i in range(m):
        for j in job[i]:
            heappush(q, j)
        if len(q) < 0:
            res += heappop(q) * -1 # -r -> r
    print(res)

if __name__ == '__main__':
    main()



### FIXED CODE ###

def main():
    n,m = map(int,input().split())
    job =[[] for _ in range(m)]
    for i in range(n):
        a,b=map(int,input().split())
        if a-1 < m:
            job[a-1].append(-b) # b:asc, -b:desc
    
    res = 0
    q = []
    from heapq import heappop, heappush
    for i in range(m):
        for j in job[i]:
            heappush(q, j)
        if len(q) > 0:
            res += heappop(q) * -1 # -b -> b
    print(res)

if __name__ == '__main__':
    main()
for i in range(10000):
    a, b = map(int, input().split())
    
    if a > b:
        print(a, b)
    else
        print(b, a)
    
    
    


### FIXED CODE ###

for i in range(3000):
    a, b = map(int, input().split())
    
    if a == b == 0:
        break
    elif a < b:
        print(a, b)
    else:
        print(b, a)
n,w=map(int,input().split())
a=[0]*(w+1)
for i in range(n):
    b=a.copy()
    x,y=map(int,input().split())
    for j in range(min(x,w),w+1):
        b[j]=max(a[j-x]+y,a[j])
    a=b.copy()
print(max(a))
        



### FIXED CODE ###

n,w=map(int,input().split())
from copy import copy
a=[0]*(w+1)
for i in range(n):
    b=copy(a)
    x,y=map(int,input().split())
    for j in range(min(x,w),w+1):
        b[j]=max(a[j-x]+y,a[j])
    a=copy(b)
print(max(a))
import math
import fractions

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

# A以上B以下の数でXの倍数の個数
def countX(X) :
    if X > B :
        return 0
    minX = max(math.ceil(A / X),0)
    maxX = max(math.floor(B / X),0)
    return maxX - minX + 1

if C == 1 or D == 1 :
    print(0)
elif min(C,D) > B :
    print(A - B + 1)
elif max(C,D) % min(C,D) == 0 :
    Z = min(C,D)
    ans = B - A + 1 - countX(Z)
    print(ans + 1)
elif A % C == 0 and A % D == 0:
    print(z)
else :
    ans = B - A + 1

    # 最小公倍数
    Z = int(C * D / fractions.gcd(C,D))

    ans -= countX(C)
    ans -= countX(D)
    ans += countX(Z)

    print(ans)



### FIXED CODE ###

import math
import fractions

# A以上B以下の数でXの倍数の個数
def countX(X) :
    if X > B :
        return 0

    minX = (A - 1) // X
    maxX = B // X

    return maxX - minX

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

ans = B - A + 1

# 最小公倍数
Z = int(C * D / fractions.gcd(C,D))

ans -= countX(C)
ans -= countX(D)
ans += countX(Z)

print(int(ans))
a=input b=input c=input
if a<b<c print Yes

### FIXED CODE ###

n=map(int, raw_input().split(' '))
a=n[0]
b=n[1]
c=n[2]
if a<b<c:
  print "Yes"
else:
  print "No"
N = int(input())
a = list(map(int,input().split()))
num = [0 for i in range(9)]
for i in range(N):
    num[a[i]//400] += 1

if num[-1] == 0:
    num = [i for i in num if i != 0]
    print(len(num),len(num))
else:
    n = num.pop(-1)
    num2 = [i for i in num if i != 0]
    print(len(num2),min(8,len(num2)+n))
    

### FIXED CODE ###

N = int(input())
a = list(map(int,input().split()))
num = [0 for i in range(9)]
for i in range(N):
    if a[i] < 3200:
        num[a[i]//400] += 1
    else:
        num[-1] += 1

if num[-1] == 0:
    num = [i for i in num if i != 0]
    print(len(num),len(num))
else:

    n = num.pop(-1)

    num2 = [i for i in num if i != 0]
    print(max(1,len(num2)),len(num2)+n)
n,m=map(int,input().split())
s=sorted([input() for i in range(m)])
print("".join(s))

### FIXED CODE ###

N,M=map(int,input().split())
s=[]
for i in range(N):
    s.append(input())
print("".join(sorted(s)))
import numpy as np
import itertools
from statistics import mean
n = int(input())
lis = [list(map(int, input().split())) for i in range(n)]
dislis = []
for i in range(n):
    dislis.append([])
    for j in range(n):
        dislis[i].append(np.sqrt((lis[i][0]-lis[j][0])**2 + (lis[i][1]-lis[j][1])**2))

lenlis = []
cnt = 0
for v in itertools.permutations(range(n+1)[1:], n):
    cnt += 1
    lenlis.append([])
    for i in range(len(v)):
        if i != len(v)-2:
            lenlis[cnt-1].append(dislis[v[i-1]-1][v[i]-1])
# for i in dislis:
#     print(i)
anslis = []
cntcnt = 0
for i in lenlis:
    anslis.append(sum(lenlis[cntcnt]))
    cntcnt += 1
print(mean(anslis))

### FIXED CODE ###

import math
import itertools
n = int(input())
lis = [list(map(int, input().split())) for i in range(n)]
dislis = []
for i in range(n):
    dislis.append([])
    for j in range(n):
        dislis[i].append(math.sqrt((lis[i][0]-lis[j][0])**2 + (lis[i][1]-lis[j][1])**2))

lenlis = []
cnt = 0
for v in itertools.permutations(range(n+1)[1:], n):
    cnt += 1
    lenlis.append([])
    for i in range(len(v)):
        if i != len(v)-2:
            lenlis[cnt-1].append(dislis[v[i-1]-1][v[i]-1])
anslis = []
cntcnt = 0
for i in lenlis:
    anslis.append(sum(lenlis[cntcnt]))
    cntcnt += 1
print(sum(anslis)/len(anslis))
a=int(inout())
if a>=3200:
  print("red")
else:
  print(input())

### FIXED CODE ###

a=int(input())
s=input()
if a<3200:
  print("red")
else:
  print(s)
n,m=map(int,input().split())
p=sorted([list(map(int,input().split()))for i in range(m)])
a=2**(n).bit_length()
b=2**31-1
s=[b]*(2*a)
def f(k,x):
    k+=a-1
    s[k]=x
    while k>=0:
        k=(k-1)//2
        s[k]=min(s[2*k+1],s[2*k+2])
def g(l,r):
    L,R=l+a,r+a
    t=b
    while L<R:
        if R&1:
            R-=1
            t=min(t,s[R-1])
        if L&1:
            t=min(t,s[L-1])
            L+=1
        L>>=1
        R>>=1
    return s
f(0,0)
for l,r,c in p:
    q=g(l-1,r-1)
    if s[r+a-2]>q+c
        f(r-1,c+q)
print(-1 if s[n+a-2]==b else s[n+a-2])

### FIXED CODE ###

from heapq import heappush,heappop
n,m=map(int,input().split())
a=[[[i-1,0]]for i in range(n+1)]
a[0]=[]
for i in range(m):
    l,r,c=map(int,input().split())
    a[l].append([r,c])
q=[float("INF")]*(n+1)
q[1]=0
c=[]
heappush(c,[0,1])
while c:
    s,t=heappop(c)
    if t==n:
        print(s)
        break
    for i,j in a[t]:
        if q[i]>s+j:
            q[i]=s+j
            heappush(c,[s+j,i])
else:
    print(-1)
import math
A = int(input())
B = int(input())
C = int(A * B)
print(C)

### FIXED CODE ###

a, b = map(int, input().split())
print(a * b)
s = "11 5 5"
list = list(map(int, input().split()))

a = abs(list[1]-list[0])
b = abs(list[1]-list[2])
c = abs(list[2]-list[0])
l = a+b
m = b + c
n = a+c
if (l < m):
	if (l < n)
		print(l)
	else :
		print(n)
else :
	if (m < n)
		print(m)
	else :
		print(n)


### FIXED CODE ###

s = "100 10 25"
list = list(map(int, input().split()))
#list = list(map(int, s.split()))

a = abs(list[1]-list[0])
b = abs(list[1]-list[2])
c = abs(list[2]-list[0])
if (a < b):
	print(b if b>c else c)
else :
	print(a if c<a else c)
num1 = input("数字を入力してください")
while str(num1).isdigit() == False:
    print("error")
    num1 = input("数字を入力してください")
    
num2 = input("数字を入力してください")
while str(num2).isdigit() == False:
    print("error")
    num2 = input("数字を入力してください")
    
num3 = int(num1) + int(num2)
num4 = int(num1) - int(num2)
num5 = int(num1) * int(num2)
num6 = [num3, num4, num5]

if -100 < int(num1) < 100 and -100 < int(num2) < 100:
    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))
n = int(input())
A = list(map(int, input().split()))
mina = 10**9
minus = 0
sumA = 0
for a in A:
    if a < 0:
        minus += 1
        a = -a
    sumA += a
    mina = min(a, mina)
if minus % 2 == 1:
    sumA -= 2 * mina
print(sumA)

### FIXED CODE ###

a, b, t = map( int, input().split() )
print(b*(t//a))
N,K = map(int, input().split())
P = list(map(int,input().split()))

def calc_expected_val(val):
    return (K+val)/2

def main():
    sum_K_list = []
    max_sum_K = 0
    max_expected_val = 0
    for i in range(N-K):
        sum_K = 0   
        for j in range(i, i+K):
            sum_K += P[j]
        sum_K_list.append(sum_K)

    max_sum_K = max(sum_K_list)
    max_expected_val = calc_expected_val(max_sum_K)    
    print(max_expected_val)

if __name__ == "__main__":
    main()
    

### FIXED CODE ###

N, K = map(int, input().split())
p = list(map(int,input().split()))
ans = 0
cum = [0]
     
for i in range(len(p)):
    ex = (1 + p[i])/2
    p[i] = ex
        
for i in  range(len(p)):
    cum.append(p[i] + cum[i])
        
for i in range(K, N+1):
    ans  = max(ans, cum[i] - cum[i-K])
     
print(ans)
M = 0
ans = 0
for i in range(5):
  a = append(int(input()))
  b = ((a + 9) // 10) * 10
  M = max(M, b-a)
  ans += b
print(ans - M)

### FIXED CODE ###

M = 0
ans = 0
for i in range(5):
  a = int(input())
  b = ((a + 9) // 10) * 10
  M = max(M, b-a)
  ans += b
print(ans - M)
# LCS: Longest common subsequence
# dp[i][j]: Sのi-1番目まで, Tのj-1番目まででの最長共通文字列
# dp[0][0] = 0 長さ0の文字列
# dp[0][1] = 0 長さ1の文字列と長さ0の文字列
# dp[1][0] = 0 長さ0の文字列と長さ1の文字列
# dp[i][j] = max(dp[i-1][j], dp[i][j-1]) (S[i] != T[j])
# dp[i][j] = max(
#                dp[i-1][j-1]+1  (共通文字列を利用する),
#                dp[i-1][j]        (共通文字列を利用しない),
#                dp[i][j-1]        (共通文字列を利用しない),
#            )


dp = [[[0, ''] for _ in range(1001)] for _ in range(1001)]

def main():
    S = input()
    T = input()

    result = solve(S, T)
    print(result[1])



def solve(S, T):
    for i, s in enumerate(S, start=1):
        for j, t in enumerate(T, start=1):
            if s != t:
                dp[i][j] = max(dp[i-1][j], dp[i][j-1], key=lambda x: x[0])
            else:
                a = dp[i-1][j-1][0]
                b = dp[i-1][j][0]
                c = dp[i][j-1][0]
                if a >= b and a >= c:
                    dp[i][j] = [dp[i-1][j-1][0] + 1, dp[i-1][j-1][1] + s]
                elif b>=a and b>= c:
                    dp[i][j] = dp[i-1][j]
                else:
                    dp[i][j] = dp[i][j-1]
    return dp[len(S)][len(T)]


if __name__ == "__main__":
    main()


### FIXED CODE ###

# LCS: Longest common subsequence
# dp[i][j]: Sのi-1番目まで, Tのj-1番目まででの最長共通文字列
# dp[0][0] = 0 長さ0の文字列
# dp[0][1] = 0 長さ1の文字列と長さ0の文字列
# dp[1][0] = 0 長さ0の文字列と長さ1の文字列
# dp[i][j] = max(dp[i-1][j], dp[i][j-1]) (S[i] != T[j])
# dp[i][j] = max(
#                dp[i-1][j-1]+1  (共通文字列を利用する),
#                dp[i-1][j]        (共通文字列を利用しない),
#                dp[i][j-1]        (共通文字列を利用しない),
#            )


dp = [[0 for _ in range(3001)] for _ in range(3001)]


def main():
    S = input()
    T = input()

    result = solve(S, T)
    print(result)


def solve(S, T):
    for i in range(1, len(S) + 1):
        for j in range(1, len(T) + 1):
            if S[i - 1] != T[j - 1]:
                dp[i][j] = max(dp[i - 1][j], dp[i][j - 1], dp[i-1][j-1])
            else:
                dp[i][j] = max(dp[i - 1][j - 1] + 1, dp[i - 1][j], dp[i][j - 1])
    result = ""
    i = len(S)
    j = len(T)
    while dp[i][j] != 0:
        if dp[i][j] == dp[i-1][j]:
            i -= 1
        elif dp[i][j] == dp[i][j-1]:
            j -= 1
        else:
            result += S[i-1]
            i -= 1
            j -= 1
    return "".join(reversed(result))


if __name__ == "__main__":
    main()
X,Y = map(float,input().split())

if (1 <= X <= 100) and (1 <= Y <= 100 ) and float.is_integer(X) and float.is_integer(Y) :
    if Y % 2 == 0:
        if Y / X <= 4:
            print("Yes")
            print()

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

### FIXED CODE ###

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

if a == 0:
    print(1)
    
elif b == 0:
    print(2)
    
elif c == 0:
    print(3)
    
elif d == 0:
    print(4)
    
elif e == 0:
    print(5)
n = int(input())

wrong = 0
for i, p in enemerate(map(int, input().split()), start=1):
  wrong += int(i != p)

if wrong == 0 or wrong == 2:
  print('YES')
else:
  print('NO')

### FIXED CODE ###

n = int(input())

wrong = 0
for i, p in enumerate(map(int, input().split()), start=1):
  wrong += int(i != p)

if wrong == 0 or wrong == 2:
  print('YES')
else:
  print('NO')
N, M = map(int, input().split())
R = [list(map(int, input().split())) for _ in range(N)]

for i in range(1,N+1):
    print(R.count(i))


### FIXED CODE ###

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

for i in range(1,N+1):
    print(R.count(i))
import math
import fractions

# A以上B以下の数でXの倍数の個数
def countX(X) :
    if X > B :
        return 0
    minX = max(math.ceil(A / X),0)
    maxX = max(math.floor(B / X),0)
    return maxX - minX + 1

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

if D == 1 :
  print(0)
else :
  ans = B - A + 1

  # 最小公倍数
  Z = int(C * D / fractions.gcd(C,D))

  ans -= countX(C)
  ans -= countX(D)
  ans += countX(Z)

print(int(ans))



### FIXED CODE ###

import math
import fractions

# A以上B以下の数でXの倍数の個数
def countX(X) :
    if X > B :
        return 0

    minX = (A - 1) // X
    maxX = B // X

    return maxX - minX

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

ans = B - A + 1

# 最小公倍数
Z = int(C * D / fractions.gcd(C,D))

ans -= countX(C)
ans -= countX(D)
ans += countX(Z)

print(int(ans))
A1=input()
A2=input()
A3=input()

if A1+A2+A3 >21:
    print("lose")
else:
    print("win")

### FIXED CODE ###

A0,A1,A2 = (int(x) for x in input().split())

if A0+A1+A2 > 21:
    print("bust")
else:
    print("win")
a,b = map(int, raw_input().split())
c = 1
for i in range(a,b+1):
	c = c * i 

if c < 0:
	print "Negative"
elif c == 0:
	print "Zero"
else:
	print "Positive"

### FIXED CODE ###

a,b = map(int, raw_input().split())
if a < 0 and b < 0:
	if (b - a)%2 == 1:
		print "Positive"
	else:
		print "Negative"
elif a * b <= 0: 
	print "Zero"
else:
	print "Positive"
cards = {
	"S":[0]*13,
	"H":[0]*13,
	"C":[0]*13,
	"D":[0]*13
}

n = int(input())

for i in range(n):
	s, num = input().split()
	c[s][int(num)-1] = 1
	
for i in ["S", "H", "C", "D"]:
	for j in range(13)
		if[i][j] == 0:
			print(i,j+)

### FIXED CODE ###

cards = {
	"S":[0]*13,
	"H":[0]*13,
	"C":[0]*13,
	"D":[0]*13
}

n = int(input())

for i in range(n):
	s, num = input().split()
	cards[s][int(num)-1] = 1
	
for i in ["S", "H", "C", "D"]:
	for j in range(13):
		if cards[i][j] == 0:
			print(i,j+1)
if A==B:
  if A!=C:
    print('Yes')
  else:
    print('No')
else:
  if A==C:
    print('Yes')
  elif B==C:
    print('Yes')
  else:
    print('No')

### FIXED CODE ###

nums = input().rstrip().split(" ")
n1 = int(nums[0])
n2 = int(nums[1])
n3 = int(nums[2])
if n1 == n2 and n2 == n3 and n1 == n3:
  print("No")
elif n1 != n2 and n2 != n3 and n1 != n3:
  print("No")
else:
  print("Yes")
n = int(input())
h=[int(input())for i in range(n)]
ans=0
for i in range(n):
  flag = True
  for j in range(i):
    if h[i]<h[j]:
      flag = False
      break
  if(flag):
    ans+=1
print(ans)

### FIXED CODE ###

n = int(input())
h=list(map(int,input().split()))
ans=0
for i in range(n):
  flag = True
  for j in range(i):
    if h[i]<h[j]:
      flag = False
      break
  if(flag):
    ans+=1
print(ans)