Harryxun/stf_run huggingface dataset:
import math

n = int(input())
s = int(input())
f = None
for i in range(2, math.ceil(math.sqrt(n))):
    c = 0
    k = n
    while k > 0:
        c += k % i
        k //= i
    if c == s:
        f = i
        break
if f is None:
    for i in range(int(math.sqrt(n)), 1, -1):
        b = n // i
        k = b
        while k > 0:
            c += k % b
            k //= b
        if (s - c) % i == 0 and b + (s - c) // i < n // (i + 1):
            print(i, b, c, s - c)
            f = b + (s - c) // i
            break
if f is None and s <= n // 2:
    f = n - s + 1
if f is None: print(-1)
else: print(f)


### FIXED CODE ###

import math

n = int(input())
s = int(input())
f = None
for i in range(2, math.ceil(math.sqrt(n))):
    c = 0
    k = n
    while k > 0:
        c += k % i
        k //= i
    if c == s:
        f = i
        break
if f is None:
    for i in range(int(math.sqrt(n)), 1, -1):
        b = n // i
        k = n
        c = 0
        while k > 0:
            c += k % b
            k //= b
        if s >= c and (s - c) % i == 0 and b - (s - c) // i > n // (i + 1):
            f = b - (s - c) // i
            break
if f is None:
    if s == n: f = n + 1
    elif s <= (n + 1) // 2: f = n - s + 1
    elif s == 1: f = n
if f is None: print(-1)
else: print(f)
n, k = map(int, input().split())

h = list(map(int, inoput().split))
sum = 0
h.sort()

for i in range(0, k):
  h[n-i-1] = 0
  
for i in range(0, n):
  sum += h[i]
  
print(sum)

### FIXED CODE ###

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

if n <= k:
  print(0)
else:
   for i in range(0, k):
    h[n-i-1] = 0
  
   for i in range(0, n):
    sum += h[i]
   
   print(sum)
K,X=(int,input().split()))
if 500*K>=X:
    print("Yes")
else:
    print("No")

### FIXED CODE ###

K,X=map(int,input().split())
if 500*K >=X:
    print("Yes")
else:
    print("No")
p = str(input())
s = list(p)
k = int(input())

zisyo = []
for i in range(len(s)):
    count = 0
    st = s[i]

    zisyo.append(st)
    onelist = list(sorted(list(set(zisyo))))
    
    if onelist.index(st) > 6:
        continue
    while count <= n:
        count = count + 1
        try:
            st = st + s[i + count]
            zisyo.append(st)
        except:
            pass
    
zisyosort = list(sorted(list(set(zisyo))))
print(zisyosort)

### FIXED CODE ###


s = str(input())
k = int(input())
kouho = [s]

for i in range(len(s)):
    for plus in range(k+1):
        st = s[i:i + plus]
        kouho.append(st)
so = list(sorted(set(kouho)))
if '' in so:
    so.remove('')
    
print(so[k-1])
# -*- coding: utf-8 -*-


a=int(input())
b=int(input())


s=0.5*(a+b)

int v= int(s)+1

print(v)


### FIXED CODE ###

# -*- coding: utf-8 -*-
"""
Created on Sat Nov  3 09:19:07 2018

@author: sk
"""

     
      
b, c = map(int, input().split())
     
s=0.5*(b+c)
     
d = int(s)
    
if s-d > 0:
    v=int(d+1)
else :
    v=int(d)
print(v)
while True:
    n,s,e = input().split()
    n = int(n)
    s = int(s)
    e = int (e)
    if not n+s+e:
        break
    s = s//100*60+s%100
    e = e//100*60+e%100
    t = [0]*60*24    
    for i in range(n):
        m = int(input())
        for j in range(m):
            ss,ee = input().split()
            ss = int(ss)
            ee = int(ee)
            t[ss//100*60+ss%100] += 1
            t[ee//100*60+ee%100] -= 1
    cnt = 0
    ans = 0
    ma = -1
    for i in range(e):
        cnt += t[i]
        if i < s:
            continue
        if not cnt:
            ans += 1
        else:
            if ma < ans:
                ma = ans
                ans = 0
    print(ma if ma > ans else ans)

### FIXED CODE ###

while True:
    n,s,e = input().split()
    n = int(n)
    s = int(s)
    e = int(e)
    if not n+s+e:
        break
    s = s//100*60+s%100
    e = e//100*60+e%100
    t = [0]*(60*24+1)
    for i in range(n):
        m = int(input())
        g = input().split()
        j = 0
        for o in g:
            a = int(o)
            if j%2:
                t[a//100*60+a%100] += 1
            else:
                t[a//100*60+a%100] -= 1
            j += 1
    cnt = n
    ans = 0
    ma = -1
    for i in range(e):
        cnt += t[i]
        if i < s:
            continue
        if cnt:
            ans += 1
        else:
            if ma < ans:
                ma = ans
            ans = 0
    print(ma if ma > ans else ans)
def solve():
    N = int(input())
    S = list(input())
    Q = int(input())
    set_dic = {}

    for i, s in enumerate(S):
        if s not in set_dic.keys():
            set_dic[s] = {i+1}
        else:
            set_dic[s].add(i+1)

    anslist = []

    for _ in range(Q):
        query1, query2, query3 = input().split()
        if query1 == "1":
            i = int(query2)
            c = query3
            set_dic[c].discard(i)
            if c not in set_dic.keys():
                set_dic[c] = {i}
            else:
                set_dic[c].add(i)
        else:
            l = int(query2)
            r = int(query3)
            ansset = set()
            ans = 0
            for eachset in set_dic.values():
                for i in range(l, r + 1):
                    if i in eachset:
                        ans += 1
                        break
            anslist.append(ans)

    for i in anslist:
        print(i)

if __name__ == '__main__':
    solve()

### FIXED CODE ###

import bisect
import sys
input = sys.stdin.readline

def solve():
    N = int(input())
    S = list(input())
    Q = int(input())
    set_dic = {}

    for i, s in enumerate(S):
        if s not in set_dic:
            set_dic[s] = [i+1]
        else:
            bisect.insort_left(set_dic[s], i+1)

    anslist = []

    for _ in range(Q):
        query1, query2, query3 = input().split()
        if query1 == "1":
            i = int(query2)
            c = query3
            cap = S[i-1]
            if cap == c:
                continue
            set_dic[cap].remove(i)
            if c not in set_dic:
                set_dic[c] = [i]
            else:
                bisect.insort_left(set_dic[c], i)
            S[i-1] = c
        else:
            l = int(query2)
            r = int(query3)
            ansset = set()
            ans = 0
            for eachlist in set_dic.values():
                li = bisect.bisect_left(eachlist, l)
                ri = bisect.bisect_right(eachlist, r)
                if li != ri:
                    ans += 1
            anslist.append(ans)

    for i in anslist:
        print(i)

if __name__ == '__main__':
    solve()
import sys
input = sys.stdin.readline
import math
def fibnatch(n):
  if n==0:
    return 1
  a=(pow(((1+math.sqrt(5))/2),n)-pow(((1-math.sqrt(5))/2),n))/math.sqrt(5)
  c=int(a)
  if n==1:
    return 1
  elif abs(c-a)>=abs(c-a+1):
    return (c+1)%1000000007
  else:
    return c%1000000007
L=list()
N,M=map(int,input().split())
a=1
for i in range(M):
  c=int(input())
  if i==0:
    L.append(c-a)
  else:
    L.append(c-a-1)
  a=c
if 0 in L[1:]:
  print(0)
  sys.exit()
L.append(N-c)
s=1
for i in range(len(L)):
  d=L[i]
  s=(s*fibnatch(d))%1000000007
print(s)

### FIXED CODE ###

N,M=map(int,input().split())
L=[0]*N
c={}
mod=1000000007
for i in range(M):
  k=int(input())
  c[k]=0
for i in range(N):
  if i==0:
    L[i]=1
  elif i==1:
    if L[0]==0:
      L[i]=1
    else:
      L[i]=2
  else:
    L[i]=(L[i-1]+L[i-2])%mod
  if i+1 in c:
    L[i]=0
print(L[N-1])
def gcd(a, b):
    if 0 == b:
        return a
    return gcd(b, a % b)


def lcm(a, b):
    return int(a * b / gcd(a, b))


def lcm_arr(arr):
    ans = arr[0]
    for i in range(1, n):
        ans = lcm(ans, arr[i])
    return ans


n = int(input())
ans = lcm_arr([int(input()) for _ in range(n)])
print(min(ans, 10 ** 18))


### FIXED CODE ###


def gcd(a, b):
    if 0 == b:
        return a
    return gcd(b, a % b)


def lcm(a, b):
    return (a * b) // gcd(a, b)


def lcm_arr(arr):
    ans = arr[0]
    for i in range(1, n):
        ans = lcm(ans, arr[i])
    return ans


n = int(input())
ans = lcm_arr([int(input()) for _ in range(n)])
print(min(ans, 10 ** 18))
import numpy as np

W, H, N = map(int, input().split())

ze = np.ones(W+1, H+1)
for i in range(N):
    x, y, a = map(int, input().split())
    
    if a == 1:
        ze[:x, :] = 0
    elif a == 2:
        ze[x+1:, :] = 0
    elif a == 3:
        ze[:, :y] = 0
    elif a == 4:
        ze[:, y+1:] = 0

print(np.sum(ze))

### FIXED CODE ###

import numpy as np

W, H, N = map(int, input().split())

ze = np.ones((W, H))

for i in range(N):
    x, y, a = map(int, input().split())

    if a == 1:
        ze[:x, :] = 0
    elif a == 2:
        ze[x:, :] = 0
    elif a == 3:
        ze[:, :y] = 0
    elif a == 4:
        ze[:, y:] = 0

print(np.sum(ze))
I,O,T,J,L,S,Z = map(int,input().split())
if I==1 and J==1 and L==1:                                                     
    print(3) 
elif ((I-1)//2+(J-1)//2+(L-1)//2)*2+O==0 and (I//2+J//2+L//2)*2+O)==0):
    print(0)
else:
    print(max(((I-1)//2+(J-1)//2+(L-1)//2)*2+O+3,(I//2+J//2+L//2)*2+O))


### FIXED CODE ###

I,O,T,J,L,S,Z = map(int,input().split())
print(max(((I-1)//2+(J-1)//2+(L-1)//2)*2+O+3*(I>0)*(L>0)*(J>0),(I//2+J//2+L//2)*2+O))
x,y=map(int,input().split())
if abs(x),abs(y)>pow(10,9):
    exit()
s=abs(y)-abs(x)
buttona=s
buttonb=0
if y < 0:
    buttonb+=1
if x < 0:
    buttonb+=1
print(buttona+buttonb)


### FIXED CODE ###

x, y = map(int, input().split())
ans = 0
if x * y >= 0:
    if x > y:
        ans = x - y + 2
        if x * y == 0:
            ans = x - y + 1
    else:
        ans = abs(y - x)
else:
    ans = abs(abs(x) - abs(y)) + 1
print(ans)
n, m = map(int, input().split())
flag = []
for _ in range(m): flag.append(True)
for _ in range(n):
    line = list(map(int, input()))
    for i in range(line[0]): flag[line[i+1]] = False
count = 0
for j in range(m):
    if(flag[j]): count += 1
print(count)

### FIXED CODE ###

n, m = map(int, input().split())
flag = []
for _ in range(m): flag.append(0)
for _ in range(n):
    line = list(map(int, input().split()))
    for i in range(line[0]): flag[line[i+1]-1] += 1
count = 0
for j in range(m):
    if(flag[j] == n): count += 1
print(count)
N,K = map(int, input().split())
P = list(map(int,input().split()))
Px  =[]
for i in range(N):
    Px.append((1+P[i])/2)
temp_num = sum(Px[0:K])
temp_max = sum(Px[0:K])
for j in range(N-K+1):
    temp_num = temp_num-Px[j]+Px[j+K]
    if temp_max <temp_num:
        temp_max=temp_num
    if j==(N-K-1):
        break
print(temp_max)

### FIXED CODE ###

N,K = map(int, input().split())
P = list(map(int,input().split()))
Px  =[]
for i in range(N):
    Px.append((1+P[i])/2)
temp_num = sum(Px[0:K])
temp_max = sum(Px[0:K])
#print(Px)
for j in range(N-K):
    #print(temp_num)
    temp_num = temp_num-Px[j]+Px[j+K]
    if temp_max <temp_num:
        temp_max=temp_num
print(temp_max)
S = list(input())
N = len(S)

RL = []
LR = []



for i in range(N-1):
    if S[i] == 'R' and S[i+1] == 'L':
        RL.append(i)
    if S[i] == 'L' and S[i+1] == 'R':
        LR.append(i)

#print(RL)
#print(LR)

if S[0] == 'L':
    RL.insert(0,0)
if S[-1] == 'R':
    RL.append(N-1)

LR.insert(0, -1)
LR.append(N-1)

#print('RL 記入')
#print(RL)
#print('LR 区切り')
#print(LR)

ans = ['0'] * N
for i in range(len(LR)-1):
    tmp = LR[i+1] - LR[i]
    if RL[i] == 0:
        ans[0] = tmp
    elif RL[i] == N-1:
        ans[N-1] = tmp
        RL.remove(N-1)
    else:
        tmplist = S[LR[i]+1:LR[i+1]+1]
        tmpR = tmplist.count('R')
        tmpL = tmplist.count('L')
        #print(tmplist)

        if (tmpR + tmpL) % 2 == 0:
            ans[RL[i]] = str(tmp // 2)
            ans[RL[i]+1] = str(tmp // 2)
        elif tmpR %2 == 1 and tmpL%2==0:
            ans[RL[i]] = str(tmp // 2 + 1)
            ans[RL[i]+1] = str(tmp // 2 )
        elif tmpR %2 == 0 and tmpL%2==1:
            ans[RL[i]] = str(tmp // 2 )
            ans[RL[i]+1] = str(tmp // 2 + 1)

print(' '.join(ans))




### FIXED CODE ###

S = list(input())
N = len(S)

RL = []
LR = []



for i in range(N-1):
    if S[i] == 'R' and S[i+1] == 'L':
        RL.append(i)
    if S[i] == 'L' and S[i+1] == 'R':
        LR.append(i)

#print(RL)
#print(LR)

#if S[0] == 'L':
#    RL.insert(0,0)
#if S[-1] == 'R':
#    RL.append(N-1)

LR.insert(0, -1)
LR.append(N-1)

#print('RL 記入')
#print(RL)
#print('LR 区切り')
#print(LR)

ans = ['0'] * N
for i in range(len(LR)-1):
    tmp = LR[i+1] - LR[i]
#    if RL[i] == 0:
#        ans[0] = str(tmp)
#    elif RL[i] == N-1:
#        ans[N-1] = str(tmp)
#        RL.remove(N-1)
#    else:
    tmplist = S[LR[i]+1:LR[i+1]+1]
    tmpR = tmplist.count('R')
    tmpL = tmplist.count('L')
    #print(tmplist)

    if (tmpR + tmpL) % 2 == 0:
        ans[RL[i]] = str(tmp // 2)
        ans[RL[i]+1] = str(tmp // 2)
    elif tmpR %2 == 1 and tmpL%2==0:
        ans[RL[i]] = str(tmp // 2 + 1)
        ans[RL[i]+1] = str(tmp // 2 )
    elif tmpR %2 == 0 and tmpL%2==1:
        ans[RL[i]] = str(tmp // 2 )
        ans[RL[i]+1] = str(tmp // 2 + 1)

print(' '.join(ans))
List = list[input().split()]
List2 = sorted(List)
print('Yes' if List2[0] + List2[1] == List2[3] else 'No') 

### FIXED CODE ###

List = sorted(list(map(int,input().split())))
print('Yes' if List[0] + List[1] == List[2] else 'No')
n=int(input().strip())
X=[]
Y=[]
A=[]
for i in range(n):
  a=int(input().strip())
  A.append(a)
  x=[]
  y=[]
  for j in range(a):
    x,y=[int(s) for s in input().split()]
  X.append(x)
  Y.append(y)
  
c=0
for i in range(n):
  l=[1]*n
  for j in range(i, n-i):
    if l[j]==0:continue
    for k in range(A[j]):
    　　l[X[j][k]] *= Y[j][k]
if c<l.count(1):
  c=l.count(1) 
  
        
  
print(c)  
   

### FIXED CODE ###

n=int(input())
X=[]
Y=[]
A=[0]*n
for i in range(n):
  A[i]=int(input())
  a=A[i]
  x=[0]*a
  y=[0]*a
  for j in range(a):
    x[j],y[j]=[int(s) for s in input().split()]
  X.append(x)
  Y.append(y)
  
s=0
for i in range(2**n):
  c=0
  d=0
  B=[0]*n
  for j in range(n):
    if((i >> j) & 1):
      c=c+1
      B[j]=1
  for k in range(n):
    if B[k]==1:
      for j in range(A[k]):
        if Y[k][j]!=B[X[k][j]-1]:
          d=-1
          break
    if d<0:
      break
  if s<c and d==0:
    s=c
      
      
print(s)
N = int(input())

a = [int(i) for i in input().split()]

i=0

c=0
max = 0
min = 0
for i in range(n):
  if a[i] >= max:
    max = a[i]
  elif a[i] <= min:
    min = a[i]
  else
    i +=1
    
print (max - min)
  


### FIXED CODE ###

n = int(input())
a = list(map(int, input().split()))
dist = []
for i in range(n):
    for j in range(n):
        if i >= j:
            continue
        dist.append(abs(a[i]-a[j]))
print(max(dist))
N,K = (int(i) for i in input().split())
H = [int(i) for i in input().split()]

c=0
for _ in range(N):
    if (H[N]>=K):
        c=c+1

print(c)

### FIXED CODE ###

N,K = (int(i) for i in input().split())
H = [int(i) for i in input().split()]

c=0
for i in range(N):
    if (H[i]>=K):
        c=c+1

print(c)
def calcurate_digit_sum(num):
    num_str = str(num)
    digit_sum = 0
    for i in num_str:
        digit_sum += int(i)

    return digit_sum

def check_harshad(num):
    digit_sum = calcurate_digit_sum(num)
    if num % digit_sum == 0:
        return("yes")
    return("no")

if __name__ == "__main__":
    N = int(input())
    print(check_harshad(N))

### FIXED CODE ###

def plan_one(time, price_base):
    price = time * price_base
    return price

if __name__ == "__main__":
    input_list = input().split(" ")
    N, A, B = int(input_list[0]), int(input_list[1]), int(input_list[2])
    price = min(plan_one(N, A), B)
    print(price)
from math import pi
r = int(input())
print(pi*r**2,2*pi*r)




### FIXED CODE ###

from math import pi
r = float(input())
print(pi*r**2,2*pi*r)
A, B = map(float, input().split())
ans = A * B
print(int(ans)

### FIXED CODE ###

A, B = input().split()
A = int(A)
B = int(B.replace('.',''))

print(A*B // 100)
from sys import stdin
readline = stdin.readline

from io import StringIO
readline = StringIO('''1
2
3
2
1
1
2
2
2
1
0''').readline

R, S, P = 1, 2, 3  # rock, scissors, paper
W, L, D = 1, 2, 3  # win, lose, draw


while True:
    hands = []
    hands.append(int(readline()))
    if hands[0] == 0:
        break
    for _ in range(4):
        hands.append(int(readline()))

    hands_set = tuple(sorted(set(hands)))
    for h in hands:
        print(rps[hands_set][h])

### FIXED CODE ###

from sys import stdin
readline = stdin.readline


R, S, P = 1, 2, 3  # rock, scissors, paper
W, L, D = 1, 2, 3  # win, lose, draw

rps = {
    (R, S, P): {R: D, S: D, P: D},
    (R, S):    {R: W, S: L},
    (S, P):    {S: W, P: L},
    (R, P):    {P: W, R: L},
    (R,):       {R: D},
    (S,):       {S: D},
    (P,):       {P: D}
    }

while True:
    hands = []
    hands.append(int(readline()))
    if hands[0] == 0:
        break
    for _ in range(4):
        hands.append(int(readline()))

    hands_set = tuple(sorted(set(hands)))
    for h in hands:
        print(rps[hands_set][h])
import sys
input = sys.stdin.readline

N,M = map(int,input().split())
if M&1:
    print(-1)
    exit()

AB = [[int(x) for x in input().split()] for _ in range(M)]

graph = [[] for _ in range(N+1)]
for a,b in AB:
    graph[a].append(b)
    graph[b].append(a)

# まずは全域木をつくる
tree = [set() for _ in range(N+1)]
visited = [False] * (N+1)
q = [1]
while q:
    x = q.pop()
    for y in graph[x]:
        if visited[y]:
            continue
        visited[y] = True
        tree[x].add(y)
        tree[y].add(x)
        q.append(y)

answer = []
out_deg = [0] * (N+1)
# 木を残して適当に決める
for a,b in AB:
    if b in tree[a]:
        continue
    answer.append('{} {}'.format(a,b))
    out_deg[a] += 1

def dfs(x = 1,parent = None):
    for y in tree[x]:
        if y == parent:
            continue
        dfs(y,x)
        if out_deg[y] & 1:
            answer.append('{} {}'.format(y,x))
            out_deg[y] += 1
        else:
            answer.append('{} {}'.format(x,y))
            out_deg[x] += 1

dfs()

print('\n'.join(answer))



### FIXED CODE ###

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

N,M = map(int,input().split())
if M&1:
    print(-1)
    exit()

AB = [[int(x) for x in input().split()] for _ in range(M)]

graph = [[] for _ in range(N+1)]
for a,b in AB:
    graph[a].append(b)
    graph[b].append(a)

# まずは全域木をつくる
tree = [set() for _ in range(N+1)]
visited = [False] * (N+1)
q = [1]
while q:
    x = q.pop()
    for y in graph[x]:
        if visited[y]:
            continue
        visited[y] = True
        tree[x].add(y)
        tree[y].add(x)
        q.append(y)

answer = []
out_deg = [0] * (N+1)
# 木を残して適当に決める
for a,b in AB:
    if b in tree[a]:
        continue
    answer.append('{} {}'.format(a,b))
    out_deg[a] += 1

def dfs(x = 1,parent = None):
    for y in tree[x]:
        if y == parent:
            continue
        dfs(y,x)
        if out_deg[y] & 1:
            answer.append('{} {}'.format(y,x))
            out_deg[y] += 1
        else:
            answer.append('{} {}'.format(x,y))
            out_deg[x] += 1

dfs()

print('\n'.join(answer))
D=int(input())
c=input().split()
c=[int(a) for a in c]
S=[]
for _ in range(D):
    s=input().split()
    s=[int(a) for a in s]
    S.append(s)
T=[]
for _ in range(D):
    t=int(input())-1
    T.append(t)
M=int(input())
numbers=[]
for _ in range(M):
    d,q=map(int,input().split())
    numbers.append([d,q])
for m in range(M):
    ans = 0
    held = [0 for _ in range(26)]
    e=numbers[m][0]-1
    q=numbers[m][1]-1
    a=T[e]
    T[e]=q
    number=[]
    whole = sum(c)
    for d in range(D):
        s = S[d]
        place = T[d]
        held[place] = d + 1
        ans += s[place]
        whole*=(d+1)
        whole+=c[place]*(d+1)
        ans-=whole
for d in range(D):
    if d%27==0:
        print(20)
    else:
        print(d%27)
        

### FIXED CODE ###

D=int(input())
c=input().split()
c=[int(a) for a in c]
S=[]
for _ in range(D):
    s=input().split()
    s=[int(a) for a in s]
    S.append(s)

for d in range(D):
    if d%27==0:
        print(20)
    else:
        print(d%27)
s = input()
if s=='Sunny':
  print('Cloudy')
elif: s=='Rainy':
    print('Sunny')
else:
  print('Rainy')

### FIXED CODE ###

s = input()
if s=='Sunny':
  print('Cloudy')
elif s=='Rainy':
    print('Sunny')
else:
  print('Rainy')
N = int(input())
arr = [i for i in range(1, N + 1)]
# N == len(arr)
nums = N*[0]
for j in range(N):
    target = arr[j]
    num = 0
    while target % 2 == 0:
        num += 1
        target /= 2
    nums[j] = num

max_index = 0
for k in range(N):
    if nums[k] > max:
        max_index = k

print(arr[max_index])



### FIXED CODE ###

N = int(input())
print("ABC" + str(N))
a,b,c,d=map(int,input().split())
if abs(a-c) <= d or (abs(a-b)<=d and ans(b-c)<=d):
    print('Yes')
else:
    print('No')

### FIXED CODE ###

a,b,c,d=map(int,input().split())
if abs(a-c) <= d or (abs(a-b)<=d and abs(b-c)<=d):
    print('Yes')
else:
    print('No')
A, B, C, D, E, F = map(int, input().split())
ans = 0
W = set()
S = set()

for i in range(F):
  x1 = 100 * A * i
  if x1 > F:
    break
  for j in range(F):
    x2 = x1 + 100 * B * j
    if x2 > F or x2 == 0:
      break
    W.add(x2)
for i in range(F):
  y1 = C * i
  if y1 > F:
    break
  for j in range(F):
    y2 = y1 + D * j
    if y2 > F:
      break
    S.add(y2)

W = list(set(W))
S = list(set(S))

for i in range(len(W)):
  for j in range(len(S)):
    tmp = S[j]/W[i]
    tmp1 = S[j] + W[i]
    if tmp1 <= F and ans < tmp <= E/100:
      ans = tmp
      ans1 = tmp1
      ans2 = S[j]
print(ans1, ans2)

### FIXED CODE ###

A, B, C, D, E, F = map(int, input().split())
ans = 0
W = set()
S = set()

for i in range(F):
  x1 = 100 * A * i
  if x1 > F:
    break
  for j in range(F):
    x2 = x1 + 100 * B * j
    if x2 > F or x2 == 0:
      break
    W.add(x2)
for i in range(F):
  y1 = C * i
  if y1 > F:
    break
  for j in range(F):
    y2 = y1 + D * j
    if y2 > F:
      break
    S.add(y2)

W = list(set(W))
S = list(set(S))

for i in range(len(W)):
  for j in range(len(S)):
    tmp = S[j]/W[i]
    tmp1 = S[j] + W[i]
    if tmp1 <= F and ans <= tmp <= E/100:
      ans = tmp
      ans1 = tmp1
      ans2 = S[j]
print(ans1, ans2)
import numpy as np
TYPE_NUM = 26

def resolve():

    inp = sys.stdin.readlines()
    D = int(inp[0])
    c = np.array(list(map(int, inp[1].split(' '))))
    s = []
    last = np.zeros(TYPE_NUM, dtype=int)
    types = []

    for i in range(2, len(inp)):
        s.append(list(map(int, inp[i].split(' '))))
    s = np.array(s, dtype=int)

    for d in range(D):
        opt_delta_satis = -10 ** 32
        opt_idx = 0
        for idx in range(TYPE_NUM):
            val = s[d, idx]
            org = last[idx]
            last[idx] = d+1
            temp_delta_satis = np.sum(-c*(d+1-last)) + val
            if opt_delta_satis < temp_delta_satis:
                opt_delta_satis = temp_delta_satis
                opt_idx = idx
            last[idx] = org
        types.append(opt_idx+1)
    print(*types, sep='\n')

resolve()

### FIXED CODE ###

import sys
import numpy as np
TYPE_NUM = 26

def resolve():

    inp = sys.stdin.readlines()
    D = int(inp[0])
    c = np.array(list(map(int, inp[1].split(' '))))
    s = []
    last = np.zeros(TYPE_NUM, dtype=int)
    types = []

    for i in range(2, len(inp)):
        s.append(list(map(int, inp[i].split(' '))))
    s = np.array(s, dtype=int)

    for d in range(D):
        opt_delta_satis = -10 ** 32
        opt_idx = 0
        for idx in range(TYPE_NUM):
            val = s[d, idx]
            org = last[idx]
            last[idx] = d+1
            temp_delta_satis = np.sum(-c*(d+1-last)) + val
            if opt_delta_satis < temp_delta_satis:
                opt_delta_satis = temp_delta_satis
                opt_idx = idx
            last[idx] = org
        types.append(opt_idx+1)
    print(*types, sep='\n')

resolve()
S = input()
T = input()
print(S+T)


### FIXED CODE ###

S, T = input().split()
print(T+S)