Harryxun/stf_run huggingface dataset:
import itertools

N=input()
XY=[ map(int, raw_input().split())  for _ in range(N) ]
XY.sort(key=lambda x:(x[0],x[1]) )

D={}

C=list( itertools.combinations( range(1,N+1), 2) )

for b1, b2 in C:
	x1=XY[b1-1][0]
	y1=XY[b1-1][1]
	x2=XY[b2-1][0]
	y2=XY[b2-1][1]

	dx=x2-x1
	dy= y2-y1
	if (dx,dy) not in D:
		D[(dx,dy)]=1
	else:
		D[(dx,dy)]+=1

print N-max( D.values() )


### FIXED CODE ###

import itertools

N=input()
if N==1:
	print 1
	quit()

XY=[ map(int, raw_input().split())  for _ in range(N) ]
XY.sort(key=lambda x:(x[0],x[1]) )

D={}

C=list( itertools.combinations( range(1,N+1), 2) )

for b1, b2 in C:
	x1=XY[b1-1][0]
	y1=XY[b1-1][1]
	x2=XY[b2-1][0]
	y2=XY[b2-1][1]

	dx=x2-x1
	dy= y2-y1
	if (dx,dy) not in D:
		D[(dx,dy)]=1
	else:
		D[(dx,dy)]+=1

print N-max( D.values() )
import math

num1= str(input()) #take input as a string
num2= str(input())

num1=str(num1)
num2=str(num2)

result= int(num1)*float(num2) #calculate the multiplication of inputs as integer and float
result= math.floor(result) #rounding down the output using floor function

print(result)

### FIXED CODE ###

A, B = map(str, input().split()) # take the input in one line
A = int(A) # convert A into integer
C = B[0]+B[2]+B[3]
C = int(C)
print(A*C//100) # printing the output

# time complixity O(1)
n=int(input())
table=sorted(list(map(int,input().split())))
for i in range(n):
    if table[i]==table[i+1]:
        print("NO")
        exit()
print("YES")


### FIXED CODE ###

n=int(input())
table=sorted(list(map(int,input().split())))
for i in range(n-1):
    if table[i]==table[i+1]:
        print("NO")
        exit()
print("YES")
H, N = map(int,input().split())
ls = [list(map(int,input().split())) for _ in range(N)]

dp = [0]*(H+1)
for i in range(1, H+1):
  for j in range(N):
    if j == 0:
      dp[i] = dp[i-ls[j][0]] + ls[j][1]
    else:
      if ls[j][0] <= i:
        dp[i] = min([dp[i], dp[i-ls[j][0]] + ls[j][1]])
      else:
        dp[i] = min([dp[i], ls[j][1]])
        
print(dp[H])    

### FIXED CODE ###

H, N = map(int,input().split())
ls = [list(map(int,input().split())) for _ in range(N)]

dp = [0]*(H+1)
for i in range(1, H+1):
  for j in range(N):
    if j == 0:
      if ls[j][0] <= i:
        dp[i] = dp[i-ls[j][0]] + ls[j][1]
      else:
        dp[i] = ls[j][1]    
    else:
      if ls[j][0] <= i:
        dp[i] = min([dp[i], dp[i-ls[j][0]] + ls[j][1]])
      else:
        dp[i] = min([dp[i], ls[j][1]])
        
print(dp[H])
x, y = map(int, input().split())
ans = 'No'
for a in range(x+1):
    b = x-a
    if 2*a+4*b == Y:
        ans = 'Yes'

print(ans)

### FIXED CODE ###

x, y = map(int, input().split())
ans = 'No'
for a in range(x+1):
    b = x-a
    if 2*a+4*b == y:
        ans = 'Yes'

print(ans)
def f(x,y):
    a[y][x]='0'
    for dx,dy in[[-1,0],[1,0],[0,-1],[0,1],[-1,-1],[1,-1],[-1,1],[1,1]]:
        dx+=x;dy+=y
        if 0<=dx<w and 0<=dy<h and a[dy][dx]=='1':f(dx,dy)
while 1:
    w,h=map(int,input().split())
    if w==0:break
    a=[list(input().split()) for _ in[0]*h];b=0
    for i in range(w):
        for j in range(h):
            if a[j][i]=='1':
                b+=1;f(i,j)
    print(b)

### FIXED CODE ###

import sys
sys.setrecursionlimit(10000)
def f(x,y):
    if 0<=x<w and 0<=y<h and a[y][x]=='1':
        a[y][x]='0'
        for dx,dy in[[-1,0],[1,0],[0,-1],[0,1],[-1,-1],[1,-1],[-1,1],[1,1]]:f(x+dx,y+dy)
while 1:
    w,h=map(int,input().split())
    if w==0:break
    a=[input().split() for _ in[0]*h];b=0
    for i in range(w):
        for j in range(h):
            if a[j][i]=='1':
                b+=1;f(i,j)
    print(b)
# -*- coding: utf-8 -*-
"""
Created on Sun Jun  2 21:00:38 2019

@author: hisaki
"""

#at coder 2019年6月2日日曜日　A問題
import sys
N, A, B, C, D = map(int, input().split())
S = input()
A_start = A -1
B_start = B -1
A_goal = C -1
B_goal = D -1

A_pos = A_start
B_pos = B_start

def func(A_pos, B_pos):
    global N
    global A_goal
    global B_goal
    
    if A_pos == A_goal and B_pos == B_goal:
        print ("Yes")
        sys.exit()
    
    if A_pos <= N-2 and S[ A_pos + 1 ] != '#' and A_pos + 1 != B_pos:#操作A
        func(A_pos+1,B_pos)
    if A_pos <= N-3 and S[ A_pos + 2 ] != '#' and A_pos + 2 != B_pos:#操作A
        func(A_pos+2,B_pos)
    if B_pos <= N-2 and S[ B_pos + 1 ] != '#' and B_pos + 1 != A_pos:#操作A
        func(A_pos,B_pos+1)
    if B_pos <= N-3 and S[ B_pos + 2 ] != '#' and B_pos + 2 != A_pos:#操作A
        func(A_pos,B_pos+2)
    
    return

func(A_pos,B_pos)
print ("No")


    
                   





            




### FIXED CODE ###

# -*- coding: utf-8 -*-
"""
Created on Sun Jun  2 22:01:55 2019

@author: hisaki
"""

import sys
N, A, B, C, D = map(int, input().split())
S = input()
A_start = A -1
B_start = B -1
A_goal = C -1
B_goal = D -1

A_pos = A_start
B_pos = B_start

flag = True
for i in range(A_pos, A_goal):
    if S[i] == '#':
        if S[i+1] == '#':
            flag = False

for i in range(B_pos, B_goal):
    if S[i] == '#':
        if S[i+1] == '#':
            flag = False
            
if flag == False:
    print ("No")
    sys.exit()
  


if A_goal < B_goal:
    print ("Yes")
    sys.exit()


if B_goal < A_goal :
    for i in range(B_pos , B_goal+1):
        if (S[i-1] == '.' or i-1 == A_pos) and (S[i]== '.') and (S[i+1] == '.'):
            print ("Yes")
            sys.exit()

            
print ("No")
N,M=map(int,input().split())
A=list(map(int,input().split()))
S=sum(A)
l=1/(4*M)
h=0
for i in range(len(A)):
  if A[i]>=l:
    h+=1
  else:
    h+=0
if h=M:
  print("Yes")
else:
  print("No")

### FIXED CODE ###

N,M=map(int,input().split())
A=list(map(int,input().split()))
S=sum(A)
l=S/(4*M)
h=0
for i in range(N):
  if A[i]>=l:
    h+=1
if h>=M:
  print("Yes")
else:
  print("No")
N=int(input())
A=[0]*N    

for i in range(N):
    A[i]=list(map(int,input().split()))
A=sorted(A,key=lambda x: (x[0],x[1]))

"""
if(N==1):
    print(A[0][0],A[0][1],A[0][2])
    exit()
H=0
x=0
y=0
for i in range(101):
    for j in range(101):
        f=0
        h=abs(i-A[0][0])+abs(j-A[0][1])+A[0][2]
        for k in range(N):
            if(h!=abs(i-A[k][0])+abs(j-A[k][1])+A[k][2]):
                f=1
                break 
        if(f==0):
            if(h>H):
                H=h
                x=i
                y=j
print(x,y,H)
"""
for cx in range(101):
    for cy in range(101):
        flag=True
        Hcand=-1
        for x,y,h in A:
            if h==0 and H>0:
                if H-abs(x-cx)-abs(y-cy)>0:
                    flag=False
                    break
            else:
                H= h+abs(x-cx)+abs(y-cy)
                if Hcand==-1:
                    Hcand=H
                else:
                    if Hcand!=H:
                        flag=False
                        break
        if flag:
            break
    if flag:
        break
print(cx,cy,H)


### FIXED CODE ###

n = int(input())
a = [list(map(int, input().split(' '))) for i in range(n)]
for x in range(101):
    for y in range(101):
        for i in range(n):
            if a[i][2] > 0:
                htop = a[i][2] + abs(x-a[i][0]) + abs(y-a[i][1])
                break
        for i in range(n):
            if a[i][2] == 0:
                if htop - (abs(x-a[i][0]) + abs(y-a[i][1])) > 0:
                    break
            if a[i][2] > 0:
                if htop - (abs(x-a[i][0]) + abs(y-a[i][1])) != a[i][2]:
                    break
        else:
            print(x,y,htop)
            exit()
a, b, x = map(int input().split())
print(b//x - a//x)

### FIXED CODE ###

a, b, x = map(int, input().split())
print(int(b//x - (a-1)//x))
S = input()
Q = int(input())

f, l = S[0],S[-1]

mod = 0
for _ in range(Q):
    Query = input()
    if Query[0] == "1":
        f, l = l, f #swap
        mod = (1 + mod) % 2
    else:
        if Query[2] == "1":
            f = Query[4]
            if mod == 0:
                S = f + S
            else:
                s = s + f
        else:
            l = Query[4]
            if mod == 0:
                S = S + l
            else:
                S = l + S
    #print("Qans",S)

if mod==0:
    print(S)
else:
    print(S[::-1])

### FIXED CODE ###

from collections import deque

S = input()
Q = int(input())
d = deque(S)
#print(d)

mod = 0 #反転が何回目か（先頭がどっちか）,偶数回の時0，奇数回の時1

for _ in range(Q):
    Query = input()
    if Query[0] == "1":
        mod = (1 + mod) % 2
    else:
        if Query[2] == "1":
            if mod == 0:
                d.appendleft(Query[4])
            else:
                d.append(Query[4])
        else:
            if mod == 0:
                d.append(Query[4])
            else:
                d.appendleft(Query[4])

S = ""
if mod==0:
    for _ in range(len(d)):
        S += d.popleft()
else:
    for _ in range(len(d)):
        S += d.pop()
print(S)
a = 1000000007

n = input()

not0 = 1
not0and9 = 1
all = 1
for i in range(n):
  not0and9 = (not0and9 * 8) % a
  not0 = (not0 * 9) % a
  all = (all * 10) % a;
  
print((all + not0and9 - 2 * not9) % a) 

### FIXED CODE ###

a = 1000000007
 
n = int(input())
 
not0 = 1
not0and9 = 1
all = 1
for i in range(n):
  not0and9 = (not0and9 * 8) % a
  not0 = (not0 * 9) % a
  all = (all * 10) % a;
  
print((all + not0and9 - 2 * not0) % a)
c1 = map(int, input().split())
c2 = map(int, input().split())
print("YES" if c1 == c2[::-1] else "NO")

### FIXED CODE ###

c1 = input()
c2 = input()
print("YES" if c1 == c2[::-1] else "NO")
import math
from functools import reduce
a = int(input())
b = list(map(int, input().split()))

d = 0


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


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


print(gcd_list(b))


### FIXED CODE ###

import math
from functools import reduce
aaa = int(input())
baa = list(map(int, input().split()))


def gcd (a,b):
    if (b == 0):
        return a
    else:
        return gcd(b, a % b)
res = baa[0]
for c in baa[1::]:
    res = gcd(res , c)
print(res)
[n, r] = map(int, input().rstrip().split(' '))

if n > 10:
    return r
else:
    return r - 100 * (10 - n)


### FIXED CODE ###

[n, r] = map(int, input().rstrip().split(' '))

if n > 10:
    print(r)
else:
    print(r + 100 * (10 - n))
N,K=map(int,input().split())
A=[int(i) for i in input().split()]
B=[1]
i=0
for i in range(K):

    B.append(A.index(B[i])+1)

    if(len(set(B))!=i+2):

        blast=B[-1]
        bfirst=B.index(blast)
        roop=len(B)-bfirst
        ans=(K-bfirst)%roop
        print(B[ans])
        exit()













### FIXED CODE ###

N, K = map(int, input().split())
A = [int(a) - 1 for a in input().split()]

if K <= N:
    p = 0
    for i in range(K):
        p = A[p]
    print(p + 1)
    exit()

p = 0
t = [-1] * N
t[0] = 0
for i in range(1, N):
    p = A[p]
    if t[p] != -1:
        break
    t[p] = i

d = i - t[p]
K -= i
K %= d

for i in range(K):
    p = A[p]
print(p + 1)
i j = map(int, input().split(" "))

if i*j % 2 == 0:
  print("Even")
else:
  print("Odd")

### FIXED CODE ###

i, j = map(int, input().split(" "))

if (i * j) % 2 == 0:
  print("Even")
else:
  print("Odd")
n = raw_input()
print(n.count("1"))

### FIXED CODE ###

n = input()
print(n.count("1"))
def fun(x)

x = int(input())

if x=0:
    return 1
else:
    return 0

print(fun(x))

### FIXED CODE ###

x = int(input())
if x==0:
    print(1)
else:
    print(0)
N,M = map(int,input().split())
P = []
Y = []
arr = [[]for j in range(10**5)]
for i in range(M):
  listA = list(map(int,input().split()))
  P.append(listA[0])
  Y.append(listA[1])
  arr[listA[0]].append(listA[1])
  arr[listA[0]].sort()
for i in range(M):
  num = Y[i]
  for k in range(M):
    if arr[P[i]][k] == Y[i]:
      break
  print(str(P[i]).rjust(6,'0')+str(k+1).rjust(6,'0'))

### FIXED CODE ###

N,M = map(int,input().split())
P = []
Y = []
arr = [[]for j in range(10**5+1)]
for i in range(M):
  listA = list(map(int,input().split()))
  P.append(listA[0])
  Y.append(listA[1])
  arr[listA[0]].append(listA[1])
for i in range(N+1):
  arr[i].sort()
for i in range(M):
  #二部探索
  left = 0
  right = len(arr[P[i]])-1
  while left <= right:
    mid = (left+right)//2
    if arr[P[i]][mid] == Y[i]:
      k = mid
      break
    elif arr[P[i]][mid] > Y[i]:
      right = mid-1
    else:
      left = mid+1
  print(str(P[i]).rjust(6,'0')+str(k+1).rjust(6,'0'))
import heapq


x, y, z, k = map(int, input().split())
x_cake = [-float('inf')] + sorted(map(int, input().split()))
y_cake = [-float('inf')] + sorted(map(int, input().split()))
z_cake = [-float('inf')] + sorted(map(int, input().split()))


index_set = set()
x_index = y_index = z_index = -1
que = []
cnt = 0
print(x_cake[-1] + y_cake[-1] + z_cake[-1])
while True:
    heapq.heappush(que, (-(x_cake[x_index-1] + y_cake[y_index] + z_cake[z_index]), (x_index-1, y_index, z_index)))
    heapq.heappush(que, (-(x_cake[x_index] + y_cake[y_index-1] + z_cake[z_index]), (x_index, y_index-1, z_index)))
    heapq.heappush(que, (-(x_cake[x_index] + y_cake[y_index] + z_cake[z_index-1]), (x_index, y_index, z_index-1)))
    popped_tuple = heapq.heappop(que)
    x_index, y_index, z_index = popped_tuple[1]
    if (x_index, y_index, z_index) not in index_set:
        index_set.add((x_index, y_index, z_index))
        cnt += 1
        print(-popped_tuple[0])
        if cnt == k-1:
            break

### FIXED CODE ###

import heapq


x, y, z, k = map(int, input().split())
x_cake = [-float('inf')] + sorted(map(int, input().split()))
y_cake = [-float('inf')] + sorted(map(int, input().split()))
z_cake = [-float('inf')] + sorted(map(int, input().split()))


index_set = set()
x_index = y_index = z_index = -1
que = []
heapq.heappush(que, (-(x_cake[-1] + y_cake[-1] + z_cake[-1]), (-1, -1, -1)))
index_set.add((-1, -1, -1))
for _ in range(k):
    popped_tuple = heapq.heappop(que)
    print(-popped_tuple[0])
    x_index, y_index, z_index = popped_tuple[1]
    if (x_index-1, y_index, z_index) not in index_set:
        heapq.heappush(que, (-(x_cake[x_index-1] + y_cake[y_index] + z_cake[z_index]), (x_index-1, y_index, z_index)))
        index_set.add((x_index-1, y_index, z_index))
    if (x_index, y_index-1, z_index) not in index_set:
        heapq.heappush(que, (-(x_cake[x_index] + y_cake[y_index-1] + z_cake[z_index]), (x_index, y_index-1, z_index)))
        index_set.add((x_index, y_index-1, z_index))
    if (x_index, y_index, z_index-1) not in index_set:
        heapq.heappush(que, (-(x_cake[x_index] + y_cake[y_index] + z_cake[z_index-1]), (x_index, y_index, z_index-1)))
        index_set.add((x_index, y_index, z_index-1))
x = int(input())

moto = 100

for i in range(100000):
    moto = int(moto*1.01)
    if moto >= x:
        ans = i+1
        break
print(ans])


### FIXED CODE ###

x = int(input())

moto = 100

for i in range(100000):
    moto = int(moto*1.01)
    if moto >= x:
        ans = i+1
        break
print(ans)
n = int(input())
s = input()

ans = 0

for i in range(n-2):
  if s[i:i+3] == "ABC":
    ans +=1

print(ans)

### FIXED CODE ###

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

total = k * 500
ans = "No"

if total >= x:
  ans = "Yes"

print(ans)
import numpy as np

n = int(input())
t,a = map(int, input().split())
h = input().split()

h = np.array(h, dtype = float)
h = t - 0.006 * h
h = abs(a-h)
print(np.argmin(h)+1)







### FIXED CODE ###


x, y = map(int, input().split())

print(x + int(y/2))
from functools import lru_cache
import sys
sys.setrecursionlimit(10**6)

def main(N, M, a_list):
    div = 10**9 + 7
    @lru_cache(maxsize=None)
    def fib(n):
        if n in a_list:
            return 0
        else:
            if n == -1:
                return 0
            elif n == 0 or n == 1:
                return 1
            else:
                return fib(n-2) % div + fib(n-1) % div
    
    
    print(fib(N) % div )


if __name__ == "__main__":
    N, M = [int(x) for x in input().split()]
    a_list = []
    for _ in range(M):
        a_list.append(int(input()))

    main(N, M, a_list)


### FIXED CODE ###


def main(P, Q, R):
    print(min([P+Q, Q+R, P+R]))

if __name__ == "__main__":
    P, Q, R = [int(x) for x in input().split()]

    main(P, Q, R)
n,m=map(int,input().split())
s=input()
t=input()

def gcd(x,y):
  r=x%y
  return gcd(y,r) if r else y
#最小公倍数
def lcm(x, y):
    return (x * y) // gcd(x, y)

L=lcm(n,m)
g=gcd(n,m)
if s[0]==t[0]:
  X=[""]*(L+1)
  print(X)
else:
  print(-1)
  exit()
for i in range(1,g):
  X[int(i*L/n)+1]=s[i]
for i in range(1,g):
  if X[int(i*L/m)+1] !="":
    if X[int(i*L/m)+1] !=t[i]:
      print(-1)
      exit()
print(L)

### FIXED CODE ###

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

def gcd(x,y):
  r=x%y
  return gcd(y,r) if r else y
#最小公倍数
def lcm(x, y):
    return (x * y) // gcd(x, y)

L=lcm(n,m)
g=gcd(n,m)
for i in range(g):
  if s[int(i*n/g)]!=t[int(i*m/g)]:
    print(-1)
    exit()
print(L)
from fraction import gcd
import sys
 
N = int(input())
A = list(map(int, input().strip().split(' ')))
 
if N == 2:
    print(max(A[0], A[1]))
    sys.exit(0)
 
G1 = [0 for i in range(N)]
G2 = [0 for i in range(N)]
 
G1[0] = A[0]
G2[N-1] = A[N-1]
#G1[1] = math.gcd(A[0], A[1])
#G2[N-2] = math.gcd(A[-1], A[-2])
for i in range(1, N):
    G1[i] = gcd(G1[i-1], A[i])
    G2[N-i-1] = gcd(G2[N-i], A[N-i-1])
 
min_g = max(G1[1], G2[-2])
for i in range(1, N-1):
    min_g = max(min_g, gcd(G1[i-1], G2[i+1]))
 
print(min_g)

### FIXED CODE ###

import sys
from fractions import gcd

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

if N == 2:
    print(max(A))
    sys.exit(0)

L = [0 for i in range(N)]
R = [0 for i in range(N)]
L[0] = A[0]
R[-1] = A[-1]

for i in range(1, N):
    L[i] = gcd(L[i-1], A[i])
    R[-i-1] = gcd(R[-i], A[-i-1])

# print(L)
# print(R)

max_gcd = max(L[-2], R[1])
for i in range(1, N-1):
    #print(math.gcd(L[i-1], R[i+1]))
    max_gcd = max(max_gcd, gcd(L[i-1], R[i+1]))

print(max_gcd)
#min_g = max(G1[-1], G2[1])
#min_g2 = [math.gcd(G1[i], G2[i+1]) for i in range(N-2)]
N=list(map(int,input()))
N.reverse()
N.append(0)
n=len(N)
pay=[0]*n
price = N.copy()

for i in range (n):
    if N[i]>5:
        pay[i]=0
        N[i+1]=N[i+1]+1
    else:
        pay[i]=N[i]


#print(price)
#print(pay)
sum_pay=sum(pay)

c=0
for i in range (n):
    if pay[i]>=price[i]:
        c=c+pay[i]-price[i]
    else:
        c=c+10+pay[i]-price[i]
        if  pay[i+1]!=0:
            pay[i+1]=pay[i+1]-1
        else:
            pay[i+1]=9
            pay[i+1]=pay[i+1]-1

sum_otsuri=c

#print(sum_otsuri)
#print(sum_pay)

sum=sum_otsuri+sum_pay
print(sum)

### FIXED CODE ###

N=list(map(int,input()))
N.reverse()
N.append(0)
n=len(N)
pay=[0]*n
price = list(N)

for i in range (n):
    if N[i]>5:
        pay[i]=0
        N[i+1]=N[i+1]+1
    elif  N[i]<5:
        pay[i]=N[i]
    else:
        if N[i+1]>=5:
            pay[i]=0
            N[i+1]=N[i+1]+1
        else:
            pay[i]=N[i]


#print(price)
#print(pay)
sum_pay=sum(pay)

c=0
for i in range (n):
    if pay[i]-price[i]>=0:
        c=c+pay[i]-price[i]
    else:
        c=c+10+pay[i]-price[i]
        pay[i+1]=pay[i+1]-1

sum_otsuri=c

#print(sum_otsuri)
#print(sum_pay)

sum=sum_otsuri+sum_pay
print(sum)
"""
author : halo2halo
date : 4, Feb, 2020
"""

import sys

# import itertools
# import math

import numpy as np

read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
INF = 10 ** 9

N, M = map(int, readline().split())
AC = 0
WA = 0
li = set()
for _ in range(M):
    p, s = readline().decode('utf8').strip().split()
    if p not in li:
        if s != 'AC':
            WA += 1
        else:
            AC += 1
            li.add(s)

print(AC, WA)


### FIXED CODE ###

"""
author : halo2halo
date : 4, Feb, 2020
"""

import sys

# import itertools
# import math

# import numpy as np

read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
INF = 10 ** 9

N, M = map(int, readline().split())
PS = [line.split() for line in readlines()]
AC = [False] * (N + 1)
WA = [0] * (N + 1)

penal = 0
for p, s in PS:
    p = int(p)
    if AC[p]:
        continue
    if s == b'WA':
        WA[p] += 1
    else:
        AC[p] = True
        penal += WA[p]

ac = sum(AC)
print(ac, penal)
a,b,c,d,e,f = map(int, input().split())
max_a = a * 100 * e * 10 ** (-2)
max_b = b * 100 * e * 10 ** (-2)
 
sugar_a = []
sugar_b = []
for i in range(1501):
    for j in range(1501):
        sugar_check = c * i + d * j
        if a * 100 + sugar_check <= f:
            sugar_a.append(sugar_check)
        if b * 100 + sugar_check <= f:
            sugar_b.append(sugar_check)
            
sugar_sort_a = sorted(list(set(sugar_a)))
sugar_sort_b = sorted(list(set(sugar_b)))
 
from bisect import bisect_left,bisect_right
sugar_max_a = sugar_sort_a[bisect_right(sugar_sort_a, max_a)-1]
a_check = sugar_max_a / (a* 100 + sugar_max_a)
 
sugar_max_b = sugar_sort_b[bisect_right(sugar_sort_b, max_b)-1] 
b_check = sugar_max_b / (b*100 + sugar_max_b)
 
if a_check >= b_check:
    print(a*100+sugar_max_a, sugar_max_a)
else:
    print(b*100+sugar_max_b, sugar_max_b)

### FIXED CODE ###

a,b,c,d,e,f = map(int, input().split())
water_list = []
for i in range(f+1):
    for j in range(f+1):
        water = a * 100 * i + b * 100 * j
        if water <= f:
            water_list.append(water)
        else:
            break
            
sugar_list = []
for i in range(f+1):
    for j in range(f+1):
        sugar = c * i + d * j
        if sugar <= f:
            sugar_list.append(sugar)
        else:
            break
            
ans = []
for i in list(set(water_list)):
    for j in list(set(sugar_list)):
        if i != 0:
            if float(j) / i  <= e / 100 and (i + j) <= f:
                ans.append((i+j, j))
                
ans_sorted = sorted(ans, key=lambda x: (x[1] / (x[0])))[-1]
print(ans_sorted[0],ans_sorted[1])
a = input()
x = sorted(list(map(int,input().split())))
cnt=0
for i in range(a-1):
  cnt += x[2*i]
print(cnt)


### FIXED CODE ###

a = int(input())
x = sorted(list(map(int,input().split())))
cnt=0
for i in range(a):
  cnt += x[2*i]
print(cnt)
n = int(input())
A = [int(x) for x in input().split() 
     if int(x) % 2 == 1 or int(x) % 6 == 0 or int(x) % 10 == 0 ]
if len(A) == N:
    print("APPROVED")
else:
    print("DENIED")

### FIXED CODE ###

N = int(input())
A = [int(x) for x in input().split() 
     if int(x) % 2 == 1 or int(x) % 6 == 0 or int(x) % 10 == 0 ]
if len(A) == N:
    print("APPROVED")
else:
    print("DENIED")
n = int(input())
a = list(map(int, input().split()))
d = [None]*3001**2
def judge(l,r):
  if l >= r:
    return a[l]
  v = l + r*3001
  if d[v] is not None: return d[v]
  res1 = a[l] - judge(l+1,r)
  res2 = a[r] - judge(l,r-1)
  if res1 < res2: res1, res2 = res2, res1
  d[v] = res1
  return res1

print(judge(0,n-1))

### FIXED CODE ###

n = int(input())
a = list(map(int, input().split()))
dp = [[None]*n for _ in range(n)]
for d in range(n):
  for l in range(n-d):
    r = l + d
    if d:
      dp[l][r] = max(a[l] - dp[l+1][r], a[r] - dp[l][r-1])
    else:
      dp[l][r] = a[l]
print(dp[0][n-1])
x = 100
print(x ** 3 + '?\n')

### FIXED CODE ###

x=int(input())
print(x**3)
n = int(input())
a = [int(input() for i in range(n)]

ans = 0
i = 0
while n > 0:
    ans += 1
    if a[i] == 2:
        print(ans)
        quit()
    else:
        i = a[i]-1
    n -= 1
print(-1)


### FIXED CODE ###

n = int(input())
a = [list(map(int, input().split())) for i in range(n)]
a = [e for row in a for e in row]
ans = 0
i = 0
while n > 0:
    ans += 1
    if a[i] == 2:
        print(ans)
        quit()
    else:
        i = a[i]-1
    n -= 1
print(-1)
# -*- coding: utf-8 -*-
N = int(input())

for _ in range(N):
    a = int(input())
    b = int(input())
    s = str(a + b)
    limit = '1' + '0'*79
    if len(s) <= limit:
        print(s)
    else:
        print('overflow')

### FIXED CODE ###

# -*- coding: utf-8 -*-
N = int(input())

for _ in range(N):
    a = int(input())
    b = int(input())
    s = str(a + b)
    if len(s) <= 80:
        print(s)
    else:
        print('overflow')
import numpy as np
a,b= map(int,input().split())
lcm = np.lcm(a, b)
print(lcm)

### FIXED CODE ###

a = int(input())
b = int(input())
if a + b == 3:
    print(3)
elif a+b == 4:
    print(2)
else:
    print(1)
X = int(input())
Y = int(input())
Z = int(input())
print(f'{Z} {X} {Y}')

### FIXED CODE ###

A, B, C = input().split()
print(C, A, B)