Harryxun/stf_run huggingface dataset:
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()))

# step1: sort red/green apples in descending order
p.sort(reverse=True)
q.sort(reverse=True)

# step2:clip necessary apples
p = p[:x]
q = q[:y]

# step3: sort red/green apples in ascending order
p.sort()
q.sort()

# step4: sort non-color apples in descending order
r.sort(reverse=True)

# step5:swap apples to eliminate the least delicious apple
r_idx = g_idx = 0
for idx in range(c):
    if r[idx] < p[r_idx] and r[idx] < q[g_idx]:
        break

    if r[idx] > p[r_idx] and r[idx] > q[g_idx]:
        if p[r_idx] < q[g_idx]:
            p[r_idx], r[idx] = r[idx], p[r_idx]
            r_idx += 1
        else:
            q[g_idx], r[idx] = r[idx], q[g_idx]
            g_idx += 1

    if r[idx] > p[r_idx]:
        p[r_idx], r[idx] = r[idx], p[r_idx]
        r_idx += 1

    if r[idx] > q[g_idx]:
        q[g_idx], r[idx] = r[idx], q[g_idx]
        g_idx += 1

print(sum(p) + sum(q))


### 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()))

# step1: sort red/green apples in descending order
p.sort(reverse=True)
q.sort(reverse=True)

# step2:clip necessary apples
p = p[:x]
q = q[:y]

# step3: sort red/green apples in ascending order
p.sort()
q.sort()

# step4: sort non-color apples in descending order
r.sort(reverse=True)

# step5:swap apples to eliminate the least delicious apple
d = []

d.extend(p)
d.extend(q)
d.extend(r)
d.sort(reverse=True)

print(sum(d[: x + y]))
from math import ceil
import numpy

K = int(input())
N = 50
M = ceil(K / N) + 49
Y = 50 - K % 50

ans = numpy.array([M] * 50)
ans[:Y] -= (K % 50 + 1)

ans = list(map(str, ans))
print(N)
print(" ".join(ans))
# cnt = 0
# while not (all(map(lambda x: x <= 49, ans))):
#     cnt += 1
#     ans.sort()
#     ans[-1] -= 50
#     ans[:49] += 1
#
# print(cnt)

### FIXED CODE ###

import numpy

K = int(input())
N = 50

ans = numpy.array([49]*50)
ans += K // N
for i in range(K % N):
    ans -= 1
    ans[i] += 50

# print(ans)
ans = list(map(str, ans))
print(N)
print(" ".join(ans))

# cnt = 0
# while not (all(map(lambda x: x <= 49, ans))):
#     cnt += 1
#     ans.sort()
#     ans[-1] -= 50
#     ans[:49] += 1
# 
# print(cnt)
n=int(input())
stack=[0]*(n+1)
a=list(map(int,input().split()))
for i in a:
  stack[i]+=1
ans=0
for i in range(1,n+1):
  if stack[i]>=i:
    ans+=i
print(n-ans)

### FIXED CODE ###

n=int(input())
stack=[0]*(n+1)
a=list(map(int,input().split()))
for i in a:
  if i<=n:
    stack[i]+=1
ans=0
for i in range(1,n+1):
  if stack[i]>=i:
    ans+=i
print(n-ans)
import sys
import math

for line in sys.stdin:
  a = line.split()
  if len(a) == 3:
    if int(a[0])*int(a[0]) + int(a[1])*int(a[1]) == int(a[2])*int(a[2]):
        print("YES")
    else:
        print("NO")

        }else{
            console.log("NO")
            
        }
    }
});

### FIXED CODE ###

import sys
import math

for line in sys.stdin:
  a = line.split()
  if len(a) == 3:
    if (int(a[0])*int(a[0]) + int(a[1])*int(a[1])) == int(a[2])*int(a[2]) or (int(a[0])*int(a[0]) + int(a[2])*int(a[2])) == int(a[1])*int(a[1]) or (int(a[2])*int(a[2]) + int(a[1])*int(a[1])) == int(a[0])*int(a[0]):
    
        print("YES")
    else:
        print("NO")
n,m=map(int, input().split())  #複数数値入力

import sys

sys.setrecursionlimit(n)

list_a = []
for i in range(m):
    list_a.append(int(input()))
    
def countWays_memo(n):
    memo = [-1]*(n+1)
    def _countWays(n):
        if n < 0:
            return 0
        elif n == 0:
            return 1
        else:
            if memo[n] > -1:
                return memo[n]
            else:
                memo[n] = _countWays(n-1) + _countWays(n-2) 
                return memo[n]
    return _countWays(n)

steps = []
now_step = -1
for i in range(len(list_a)):
    steps.append(list_a[i]-now_step-2)
    now_step = list_a[i]
steps.append(n-now_step-1)

if steps[0] == 0:
    steps[0] = 1

dict_steps = {}
for s in set(steps):
    if s == 0:
        print(0)
    else:
        dict_steps[s] = steps.count(s)

ans = 1
for k,v in dict_steps.items():
    ans *= countWays_memo(k)**v
    
if steps.count(0) == 0:
    print(ans% 1000000007)

### FIXED CODE ###

n,m=map(int, input().split())  #複数数値入力

import sys

sys.setrecursionlimit(10**9)

def countWays_memo(n):
    memo = [-1]*(n+1)
    def _countWays(n):
        if n < 0:
            return 0
        elif n == 0:
            return 1
        else:
            if memo[n] > -1:
                return memo[n]
            else:
                memo[n] = _countWays(n-1) + _countWays(n-2) 
                return memo[n]
    return _countWays(n)
    
if m == 0:
    print(countWays_memo(n)% 1000000007)
else:
    list_a = []
    for i in range(m):
        list_a.append(int(input()))

    steps = [list_a[0]]
    now_step=list_a[0]+1
    for i in range(len(list_a)-1):
        steps.append(list_a[i+1]-now_step)
        now_step = list_a[i+1]+1
    steps.append(n-now_step+1)


    dict_steps = {}
    for s in set(steps):
        dict_steps[s] = steps.count(s)

    ans = 1
    for k,v in dict_steps.items():
        ans *= countWays_memo(k-1)**v

    print(ans% 1000000007)
(n, m, l) = [int(i) for i in input().split()]
A = []
for nc in range(n): 
????????A.append([int(i) for i in input().split()])
B = []
for mc in range(m): 
????????B.append([int(i) for i in input().split()])
??
product = [[0 for d in range(l)] for dd in range(n)]
??????????????
for nc in range(n):
????????for lc in range(l): 
????????????????for mc in range(m):
????????????????????????product[nc][lc] += A[nc][mc] * B[mc][lc] 
??
for r in product: 
????????print(' '.join([str(d) for d in r]))

### FIXED CODE ###

n, m, L = map(int, input().split())
   
a = [list(map(int, input().split())) for _ in range(n)]
b = [list(map(int, input().split())) for _ in range(m)]
c = [[sum(ak * bk for ak, bk in zip(ai,bj)) for bj in zip(*b)] for ai in a]
   
for ci in c:
    print(*ci)
N,K = map(int,input().split())
P = list(map(int, input().split()))
 
A = 0
for i in range(N-K+1):
  B = 0
  for j in range(K):
    B += (1 + P[i+j])/2
    if B > A:
      A = B
 
print(A)

### FIXED CODE ###

S,T = map(str,input().split())
A,B = map(int,input().split())
U = input()

if U == S:
  A -=1
else:
  B -= 1

print(str(A) +" " + str(B))
#!/usr/bin/env python
# coding: utf-8

# In[1]:
import sys
sys.setrecursionlimit(10000)


N, u, v = map(int, input().split())
u = u - 1
v = v - 1


# In[2]:


eda = [[] for _ in range(N)]
for _ in range(N-1):
    A, B = map(int, input().split())
    eda[A-1].append(B-1)
    eda[B-1].append(A-1)


# In[3]:


eda


# In[ ]:





# In[4]:


def dfs(n1, n0):
    houmon[n1] = True
    par[n1] = n0
    for n2 in eda[n1]:
        if not houmon[n2]:
            dfs(n2, n1)
    


# In[5]:


houmon = [False] * N
par = [0] * N
dfs(v, v)


# In[6]:


par


# In[7]:


dis = 0
n = u
while n != v:
    n = par[n]
    dis += 1


# In[8]:


dis


# In[9]:


n = u
for _ in range((dis - 1) // 2):
    n = par[n]


# In[10]:


n


# In[11]:


def dfs2(n1):
    ret = 0
    for n2 in eda[n1]:
        if n2 == par[n1]:
            continue
        ret = max(ret, dfs2(n2) + 1)
    return ret


# In[12]:


y = (dis - 1) // 2
x = dis - y
z = dfs2(n)


# In[13]:


print(y + z + 1 if dis % 2 == 0 else y + z)



### FIXED CODE ###

#!/usr/bin/env python
# coding: utf-8

# In[21]:


N, u, v = map(int, input().split())
u = u - 1
v = v - 1


# In[22]:


eda = [[] for _ in range(N)]
for _ in range(N-1):
    A, B = map(int, input().split())
    eda[A-1].append(B-1)
    eda[B-1].append(A-1)


# In[25]:


par = [0] * N
# depth = [0] * N

stack = [v]
par[v] = -1

while stack:
    n1 = stack.pop()
    for n2 in eda[n1]:
        if n2 == par[n1]:
            continue
        par[n2] = n1
#         depth[n2] = depth[n1] + 1
        stack.append(n2)
        


# In[26]:


par


# In[27]:


dis = 0
n = u
while n != v:
    n = par[n]
    dis += 1


# In[28]:


n = u
for _ in range((dis - 1) // 2):
    n = par[n]


# In[29]:


y = (dis - 1) // 2
x = dis - y
# z = depth[n]


# In[38]:


stack = [n]
depth = [0] * N
maxd = 0

while stack:
    n1 = stack.pop()
    for n2 in eda[n1]:
        if n2 == par[n1]:
            continue
        depth[n2] = depth[n1] + 1
        maxd = max(maxd, depth[n2])
        stack.append(n2)
        


# In[41]:


z = maxd


# In[43]:


if dis % 2 == 0:
    print(y + z + 1)
else:
    print(y + z)


# In[ ]:
n = int(input())
l = [int(input()) for i in range(n)]
wa = sum(l)
cnt = 0
for i in l:
    if i % 10:
        cnt += 10
if cnt == n:
    print(0)
    exit()
    
if wa % 10 != 0:
    print(wa)
else:
    l.sort()
    for i in l:
        if i % 10 != 0:
            ex = i
            break
    
    print(wa - ex)

### FIXED CODE ###

n = int(input())
l = [int(input()) for i in range(n)]
wa = sum(l)
cnt = 0
for i in l:
    if i % 10 == 0:
        cnt += 1
        
if cnt == n:
    print(0)
    exit()
    
if wa % 10 != 0:
    print(wa)
else:
    l.sort()
    for i in l:
        if i % 10 != 0:
            print(wa - i)
            break
from math import log10 as log
A = []
while True:
    S =list(map(int,input().split()))
    try:
        A.append(int(log(S[0]+S[1])+1))
    except IndexError:
        break
for i in A:
    print(i)

### FIXED CODE ###

from math import log10 as log
from sys import stdin
A = []
for po in stdin:
    S = list(map(int,po.split()))
    A.append(int(log(S[0]+S[1])+1))
for i in A:
    print(i)
a,b=map(int,input().split())
count=0
ans=1
if b=1:
  print("0")
else:
  while ans<b:
    ans=ans+a-1
    count+=1
  
  print(count)


### FIXED CODE ###

a,b=map(int,input().split())
c=0
d=1
while d<b:
  d=d+a-1
  c=c+1
  
print(c)
def find(parent,i):
    t = parent[i]
    if t < 0:
        return i
    else:
        t = find(parent,i)
        parent[i] = t
        return t
def unite(parent,i,j):
    i = find(parent,i)
    j = find(parent,j)
    if i == j:
        return
    else:
        parent[j] += parent[i]
        parent[i] = j
n,m = map(int,input().split())
parent = [-1] * n
ans = n*(n-1)//2
ansl = []
l0 = []
for i in range(m):
    ab = list(map(int,input().split()))
    l0.append(ab)
l0.reverse()
for i in range(m):
    ansl.append(ans)
    if find(parent,l0[i][0]) != find(parent,l0[i][1]):
        ans -= parent[find(parent,l0[i][0])] * parent[find(parent,l0[i][1])]
    unite(parent,l0[i][0],l0[i][1])
ansl.reverse()
for i in range(m):
    print(ansl[i])

### FIXED CODE ###

import sys
sys.setrecursionlimit(10 ** 5)
def find(parent,i):
    t = parent[i]
    if t < 0:
        return i
    t = find(parent,t)
    parent[i] = t
    return t
def unite(parent,i,j):
    i = find(parent,i)
    j = find(parent,j)
    if i == j:
        return
    parent[j] += parent[i]
    parent[i] = j
n,m = map(int,input().split())
parent = [-1] * n
ans = n*(n-1)//2
ansl = []
l0 = []
for i in range(m):
    ab = list(map(int,input().split()))
    ab[0] -= 1
    ab[1] -= 1
    l0.append(ab)
l0.reverse()
for i in range(m):
    ansl.append(ans)
    a,b = l0[i]
    if find(parent,a) != find(parent,b):
        ans -= parent[find(parent,a)] * parent[find(parent,b)]
    unite(parent,a,b)
ansl.reverse()
for i in range(m):
    print(ansl[i])
#ABC071C
N=int(input())
A=list(map(int,input().split()))
max_A=max(A)
lines=[0]*(max_A+1)
long_line=0
ans=0
for i in range(N):
    lines[A[i]]+=1
if max(lines)<2:
    print(int(ans))
else:
    for i in range(max_A):
        j=max_A-i
        if lines[j]>=4:
            if long_line>0:
                ans=j*long_line
                break
            else:
                ans=j*j
                break
        elif lines[j]>=2:
            if long_line>0:
                ans=j*long_line
                break
            else:
                long_line=j
    print(int(ans))

### FIXED CODE ###

#ABC071C
N=int(input())
A=list(map(int,input().split()))
A_sorted=sorted(A,reverse=True)
long_line=0
lines=1
for i in range(N-1):
    if A_sorted[i]==A_sorted[i+1]:
        lines+=1
    if A_sorted[i]!=A_sorted[i+1] or i==N-2:
        if lines>=4:
            if long_line>0:
                print(long_line*A_sorted[i])
                exit()
            else:
                print(pow(A_sorted[i], 2))
                exit()
        elif lines>=2:
            if long_line>0:
                print(long_line * A_sorted[i])
                exit()
            else:
                long_line=A_sorted[i]
        lines=1
print(0)
n = int(input())
count = 0
for i in range(n):
  x = int(input())
  for j in range(x):
    if x == 2:
      count += 1
    elif x % 2 == 0:
      continue
    else:
      if x % j != 0:
        count += 1
print(count)

### FIXED CODE ###

n = int(input())
count = 0
for i in range(n):
  x = int(input())
  if x == 2:
    count += 1
  elif x % 2 == 0:
    continue
  else:
    if pow(2, x - 1, x) == 1: 
      count += 1
print(count)
n, m = map(int, input().split())
stack = [1]*n
p = [False]*n
p[0] = True

for i in range(m):
    x, y = map(int, input().split())
    stack[x-1] -= 1
    stack[y-1] += 1
    p[y-1] = p[x-1] or p[y-1]
    if stack[0] == 0:
        p[0] = False

for i in p:
    if i:
        ans += 1
print(ans)

### FIXED CODE ###

n, m = map(int, input().split())
stack = [1]*n
p = [False]*n
p[0] = True

for i in range(m):
    x, y = map(int, input().split())
    stack[x-1] -= 1
    stack[y-1] += 1
    p[y-1] = p[x-1] or p[y-1]
    if stack[x-1] == 0:
        p[x-1] = False

ans = 0
for i in p:
    if i:
        ans += 1
print(ans)
# -*- coding: <encoding name> -*-

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

count = 0

for i in h:
	if i >= k:
		count++

print(count)

### FIXED CODE ###

# -*- coding: <encoding name> -*-

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

count = 0

for i in h:
	if i >= k:
		count += 1

print(count)
a,b=map(int,input().split())
k=int(input())
for i in range (k):
  if a > 0:
    a-=1
  elif　a<=0:
  	if b > 0:
      b-=1
  elif a==0 and b==0:
    break
    	print(0)
print(a, b)

### FIXED CODE ###

a,b,k=map(int,input().split())
if a-k>=0:
    print(a-k,b)
elif a+b>=k:
    print(0,a+b-k)
else:
    print(0,0)
S W
if W>=(S/2):
  print('safe')
else:
  print('unsafe')



### FIXED CODE ###

S,W = map(int, input().split())
if W >= S:
  print('unsafe')
else:
  print('safe')
a,b,c = map(int,input().split()
print(b*(c//a))

### FIXED CODE ###

a,b,c = map(int,input().split())
print(b*int(c/a))
from collections import namedtuple, defaultdict
import pprint


class Node:

    def __init__(self, p):
        self.index = p
        self.count = 0

    def __repr__(self):
        return f"{self.index}({self.count})"


def dfs(tree, count, p, x):
    # print("dfs", p, x)
    count[p] += x
    for node in tree[p]:
        dfs(tree, count, node.index, x)


def main():
    N, Q = map(int, input().split())
    tree = defaultdict(list)
    count = {i+1: 0 for i in range(N)}

    for _ in range(N-1):
        a, b = map(int, input().split())
        tree[a].append(Node(b))
    # pprint.pprint(tree)

    for _ in range(Q):
        p, x = map(int, input().split())
        dfs(tree, count, p, x)

    # pprint.pprint(count)
    print(" ".join(map(str, count.values())))


if __name__ == '__main__':
    main()

### FIXED CODE ###

from collections import defaultdict, deque


def main():
    N, Q = map(int, input().split())

    tree = defaultdict(list)
    counter = defaultdict(int)
    for _ in range(N-1):
        a, b = map(int, input().split())
        tree[a].append(b)
        tree[b].append(a)
    for _ in range(Q):
        p, x = map(int, input().split())
        counter[p] += x

    # bfs
    q = deque([1])
    visited = {1}

    while q:
        i = q.popleft()

        for j in tree[i]:
            if j not in visited:
                q.append(j)
                counter[j] += counter[i]
                visited.add(j)

    counts = [counter[i] for i in range(1, N+1)]
    ans = " ".join(map(str, counts))
    print(ans)



if __name__ == '__main__':
    main()
N = int(input())
AC = 0
WA = 0
TLE = 0
RE = 0
for i in range(N):
    s = input()
    if s == 'AC':
        AC += 1
    elif s == 'WA':
        WA += 1
    elif s == 'TLE':
        TLE += 1
    else:
        RE += 1
print('AC', 'x', AC)
print('WA', 'x', WA)
print('TLE', 'x', TLE)
print('RE', 'x', RE)
    

### FIXED CODE ###

N = int(input())
if N % 1000 > 0:
    print(1000 - (N % 1000))
elif N % 1000 == 0:
    print(0)
s = input()
print(S.replace(',',' ')）

### FIXED CODE ###

s = input()
print(s.replace(',',' '))
S = input()
S1 = []
for i in S:
  if i not in S1:
    S1.append(i)
if len(S1) == 2:
  print('Yes')
else:
  prin('No')

### FIXED CODE ###

S = input()
S1 = []
for i in S:
  if i not in S1:
    S1.append(i)
if len(S1) == 2:
  print('Yes')
else:
  print('No')
n,d = map(int,input().split())
ans = 0
import numpy as np
for i in range(n):
  x,y = map(int,input().split())
  if np.norm(np.array([x,y]),ord=2) <= d:
    ans+=1
    
print(ans)

### FIXED CODE ###

n,d = map(int,input().split())
ans = 0
import numpy as np
for i in range(n):
  x,y = map(int,input().split())
  if np.linalg.norm(np.array([x,y]),ord=2) <= d:
    ans+=1
    
print(ans)
n = input()
for i in range(len(n)):
  if n[i] == '1':
    n[i] = '9'
  elif n[i] == '9':
    n[i] = '1'
print(n)


### FIXED CODE ###

n = list(input())
for i in range(len(n)):
  if n[i] == '1':
    n[i] = '9'
  elif n[i] == '9':
    n[i] = '1'
print("".join(n))
A=int(input())
B=int(input())

if B<=A:
    ans=1
else:
    for k in range(2,31):
        if (k-1)*A-(k-2)<B and B<=k*A-(k-1):
            ans=k
        else:
            k=k+1
print(ans)

### FIXED CODE ###

A,B=map(int,input().split())
if B==1:
    ans=0
elif 1<B and B<=A:
    ans=1
else :
    for k in range(2,100):
        if (k-1)*A-(k-2)<B and B<=k*A-(k-1):
            ans=k
        else:
            k=k+1
print(ans)
import collections
import math
N = int(input())
A = list(map(int, input().split()))
ans = 0

for i in range(N):
  li = A[:i] + A[i+1]
  c = collections.Counter(li)
  l = [i for i in C.items() if i > 1]
  for num in l:
    ans += math.factorial(num) // (math.factorial(num-2) * 2)
    
print(ans)

### FIXED CODE ###

import collections
N = int(input())
A = list(map(int, input().split()))
c = collections.Counter(A)
total = 1

for n in c.items():
  total += n[1]*(n[1]-1)//2

for i in range(N):
  print(total-c[A[i]])
#include <bits/stdc++.h>
using namespace std;

int main(){
  long long N;
  cin >>N;
  
  
  vector<long long> A(N);
  for(int i=0; i<N; i++){
    cin >> A[i];
  }
  
  sort(begin(A),end(A));
  
  long long answer=1;
  for(int i=0; i<N; i++){
    answer*=A[i];
  }
  
  if(answer>1000000000000000000){
  	cout<< -1 << endl;
  }else{
    cout << answer << endl;
  }
  
}


### FIXED CODE ###

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

for i in range(n):
  answer*=A[i]
  if(answer>10**18):
    print(-1)
    exit()
    
print(answer)
A, B, C = map(int, raw_input().split())
if (A != 5 and A!=7):
	print('NO')
if (B != 5 and B!=7):
	print('NO')
if (C != 5 and C!=7):
	print('NO')
if(A + B + C != 17):
	print('NO')
else:
	print('YES')


### FIXED CODE ###

A, B, C = map(int, input().split())
if (A != 5 and A!=7):
	print('NO')
if (B != 5 and B!=7):
	print('NO')
if (C != 5 and C!=7):
	print('NO')
if(A + B + C != 17):
	print('NO')
else:
	print('YES')
from collections import deque

n, m = map(int, input().split())
d = []

mas = []
    for i in range(n):
        mas.extend(list(map(list, input().split())))
        d.append([float("inf")] * m)


def tansaku(sx, sy, d):

    dx = [1, 0, -1, 0]
    dy = [0, 1, 0, -1]

    que = deque([])
    que.append((sx, sy))
    d[sx][sy] = 0
    while que:
        # キューの先頭を取り出す
        p = que.popleft()
        for i in range(4):
            # 移動4方向をループ
            nx = p[0] + dx[i]
            ny = p[1] + dy[i]
            if (
                0 <= nx < n
                and 0 <= ny < m
                and mas[nx][ny] != "#"
                and d[nx][ny] == float("inf")
            ):
                # 移動できるならキューに入れ，その点の距離を p からの距離 +1 で確定する
                que.append((nx, ny))
                d[nx][ny] = d[p[0]][p[1]] + 1
        d_max = max(list([max(d[0]), max(d[n-1]), max(d[:][0]), max(d[:][m-1])]))
    return d_max

dis = 0
for i in range(n):
    dis_i = tansaku(i, 0,d)
    if dis_i > dis:
        dis = dis_i
    dis_i = tansaku(i, m-1,d)
    if dis_i > dis:
        dis = dis_i

for i in range(m):
    dis_i = tansaku(0, i,d)
    if dis_i > dis:
        dis = dis_i
    dis_i = tansaku(n-1, i,d)
    if dis_i > dis:
        dis = dis_i

print(dis)

### FIXED CODE ###

# -*- coding: utf-8 -*-

import numpy as np
import copy
from collections import deque

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

# マス目と距離保存のための箱を作成
d = []
mas = []
for i in range(n):
    mas.extend(list(map(list, input().split())))
    d.append([float("nan")] * m)


def tansaku(sx, sy, d):
    local_d = copy.deepcopy(d)
    dx = [1, 0, -1, 0]
    dy = [0, 1, 0, -1]

    que = deque([])
    que.append((sx, sy))
    local_d[sx][sy] = 0
    while que:
        # キューの先頭を取り出す
        p = que.popleft()
        for i in range(4):
            # 移動4方向をループ
            nx = p[0] + dx[i]
            ny = p[1] + dy[i]
            if (
                0 <= nx < n
                and 0 <= ny < m
                and mas[nx][ny] != "#"
                and not local_d[nx][ny] == local_d[nx][ny]
            ):
                # 移動できるならキューに入れ，その点の距離を p からの距離 +1 で確定する．最後Nan判定
                que.append((nx, ny))
                local_d[nx][ny] = local_d[p[0]][p[1]] + 1
    d_max = int(np.nanmax(np.array(local_d)))
    return d_max


dis = 0
for i in range(n):
    for j in range(m):
        if mas[i][j] != "#":
            dis_i = tansaku(i, j, d)
            if dis_i > dis:
                dis = copy.copy(dis_i)

print(dis)
N = int(input())
if N[-1] == 2 or 4 or 5 or 7 or 9:
    print("hon")
if N[-1] == 0 or 1 or 6 or 8:
    print("pon")
if N[-1] == 3:
    print("bon")

### FIXED CODE ###

N = input()
a = int(N[-1])

if a == 2 or a ==4or a ==7 or a == 9 or a ==5:
    print("hon")
if a == 0 or a ==1 or a==6 or a==8:
    print("pon")
if a == 3:
    print("bon")
a_s, b_s = input().split()

a = int(a_s)
b = int(float(b_s) * 100)

print(int(str(a*b)[:-2]))

### FIXED CODE ###

a_s, b_s = input().split()

b_s = b_s.replace(".", "")

s = str(int(a_s) * int(b_s))
if len(s) > 2:
    print(str(int(a_s) * int(b_s))[:-2])
else:
    print(0)
N, K = map(int, input().split())
c = 0
n = 0
for i in range(K):
  d = int(input())
  List = list(map(int, input().split()))
for I in range(N):
  n = n+1
  if n in List:
  else:
    c = c+1
print(c)

### FIXED CODE ###

def resolve():
    N, K = map(int, input().split())
    A = []
    for i in range(K):
        d = int(input())
        a = list(map(int, input().split()))
        A.extend(a)
    print(N - len(set(A)))
resolve()
import numpy as np
x=int(input())
v=0
count=1
while v==0:
    if x<=2*(count)**5:
        v=1
    else:
        count+=1
for i in range(-1*count,count):
    if i**5+x<0:
        m=np.power(-1*(i**5+x),0.2)
        m=-1*m
    else:
        m=np.power(i**5+x,0.2)
    M=int(m)
    if m-M<=10**(-5):
        b=i
        a=M
        break
print(a,b)


### FIXED CODE ###

import math
X=int(input())
x=1
while 1:
    if X<2*pow(x,5):
        break
    x+=1
while 1:
    M=pow(x,5)-X
    if M<0:
        M=-1*M
        if pow(M,0.2)-int(pow(M,0.2))<=pow(10,-6):
            print(x,-1*(int(pow(M,0.2))))
            break
    else:
        if pow(M,0.2)-int(pow(M,0.2))<=pow(10,-6):
            print(x,int(pow(M,0.2)))
            break
    x+=1