Harryxun/stf_run huggingface dataset:
s=input()
t=input()

print(s)
a = len(s)
b = len(t)
c = a-b;
min1 = 0;
min2 = 0;
for i in range(c):
  for j in range(b):
    if s[j]==t[i+j]:
      min2 += 1
  if min1>min2:
    min1 = min2
print(min1)

### FIXED CODE ###

s=input()
t=input()

a = len(s)
b = len(t)
c = a-b;
min1 = 0;
min2 = 0;
for i in range(c+1):
  for j in range(b):
    
    if s[j+i]==t[j]:
      
      min2 += 1
  if min1<min2:
    min1 = min2
  min2 =0
print(b-min1)
import numpy as np
import copy
import itertools
h = int(input())
w = int(input())
k = int(input())
s = [list(input()) for i in range(h)]
data = np.zeros(h*w).reshape(h,w)
for i in range(h):
    for j in range(w):
        if s[i][j] == '#':
            data[i][j] = 1

ans = 0
## 塗らない場合
if np.sum(data == 1) == k:
    ans = 1
## すべて塗った場合
if k == 0:
    ans = 1

a = list()
b = list()
for i in range(1,h):
    a += list(itertools.combinations(range(h), i))
for i in range(1,w):
    b += list(itertools.combinations(range(w), i))

for i in a:
    for j in b:
        temp = data.copy()
        temp[i,:] = 2
        temp[:,j] = 2
        if np.sum(temp == 1) == k:
            ans += 1

for i in a:
    temp = data.copy()
    temp[i,:] = 2
    if np.sum(temp == 1) == k:
        ans += 1
        
for j in b:
    temp = data.copy()
    temp[:,j] = 2
    if np.sum(temp == 1) == k:
        ans += 1
        
print(ans)

### FIXED CODE ###

import numpy as np
import copy
import itertools
h,w,k = map(int, input().split())
s = [list(input()) for i in range(h)]
data = np.zeros(h*w).reshape(h,w)
for i in range(h):
    for j in range(w):
        if s[i][j] == '#':
            data[i][j] = 1
 
ans = 0
## 塗らない場合
if np.sum(data == 1) == k:
    ans = 1
## すべて塗った場合
if k == 0:
    ans = 1
 
a = list()
b = list()
for i in range(1,h):
    a += list(itertools.combinations(range(h), i))
for i in range(1,w):
    b += list(itertools.combinations(range(w), i))
 
for i in a:
    for j in b:
        temp = data.copy()
        temp[i,:] = 2
        temp[:,j] = 2
        if np.sum(temp == 1) == k:
            ans += 1
 
for i in a:
    temp = data.copy()
    temp[i,:] = 2
    if np.sum(temp == 1) == k:
        ans += 1
        
for j in b:
    temp = data.copy()
    temp[:,j] = 2
    if np.sum(temp == 1) == k:
        ans += 1
        
print(ans)
a = int(input())
b = int(intpu())
if a > b:
  print('GREATER')
elif a < b:
  print('LESS')
else:
  print('EQUAL')

### FIXED CODE ###

a = int(input())
b = int(input())
if a > b:
  print('GREATER')
elif a < b:
  print('LESS')
else:
  print('EQUAL')
n,m=map(int,input().split())
h=[0]+list(map(int, input().split()))
roads=[[] for _ in range(n+1)]
cnt=0
for i in range(m):
    a,b=map(int,input().split())
    roads[a].append(b)
    roads[b].append(a)
 
for i in range(1,n+1):
    for j in roads[i]:
        if h[i]<=h[j]:
            break
    else:
         cnt+=1
    
print(cnt

### FIXED CODE ###

n,m=map(int,input().split())
h=[0]+list(map(int, input().split()))
roads=[[] for _ in range(n+1)]
cnt=0
for i in range(m):
    a,b=map(int,input().split())
    roads[a].append(b)
    roads[b].append(a)

for i in range(1,n+1):
    for j in roads[i]:
        if h[i]<=h[j]:
            break
    else:
         cnt+=1
    
print(cnt)
s=[1,2,3];s.pop(int(input());s.pop(int(input());print(s[0])

### FIXED CODE ###

print(6-int(input())-int(input()))
import math


N, K = map(int, input().split())
h = [int(i) for i in input().split()]
dp = [math.inf] * N

# 初期条件
dp[0] = 0
dp[1] = abs(h[1] - h[0])

for i in range(2, N):
    for j in range(1, K + 1):
        if i - j < 0:
            break
            
        dp[i] = min(
            dp[i],
            dp[i - j] + abs(h[i] - h[i - j])
        )

print(dp[N - 1])


### FIXED CODE ###

import numpy as np


N, K = map(int, input().split())
h = np.array([int(i) for i in input().split()])
dp = np.full(N, 10 ** 10)

# 初期条件
dp[0] = 0
dp[1] = abs(h[1] - h[0])

for i in range(2, N):
    ik = max(0, i - K)
    dp[i] = np.min(dp[ik:i] + np.abs(h[i] - h[ik:i]))

print(int(dp[-1]))
N, K = map(int, input().split())
p = list(map(int, input().split()))
s = sum(p[:K])
m = sum(p[:K])
for i in range(K, N + 1):
    s = s - p[i - K] + p[i]
    if s >= m:
      m = s
print((m + K) / 2)

### FIXED CODE ###

N, K = map(int, input().split())
p = list(map(int, input().split()))
s = sum(p[:K])
m = sum(p[:K])
if K == N:
  print((s + N) / 2)
else:
  for i in range(K, N):
      s = s - p[i - K] + p[i]
      if s >= m:
        m = s
  print((m + K) / 2)
n = int(input())
vv = list(map(int, input().split(' ')))
 
vv.sort()
 
ans += vv[0]
for v in vv[1:]:
  ans += v
  ans /= 2
  
print(ans)

### FIXED CODE ###

n = int(input())
vv = list(map(int, input().split(' ')))
 
vv.sort()
 
ans = vv[0]
for v in vv[1:]:
  ans += v
  ans /= 2
  
print(ans)
def main():
    import sys
    import numpy as np
    input = sys.stdin.readline

    N, K = map(int, input().split())
    P = np.array(list(map(float, input().split())))
    p_cumsum = np.cumsum(P)

    ans = 0
    for i in range(len(p_cumsum)-K):
        ans = max(ans, p_cumsum[i+K]-p_cumsum[i])
    ans = (K + ans) * 0.5

    print(ans)

if __name__ == '__main__':
    main()

### FIXED CODE ###

import numpy as np

N, K = map(int, input().split())
E = list(map(lambda x: (int(x)+1)/2, input().split()))
E_cumsum = np.cumsum(E)

ans = E_cumsum[K-1]
for i in range(0, N-K):
    e = E_cumsum[i+K] - E_cumsum[i]
    ans = max(ans, e)
print(ans)
from collections import deque
sys.setrecursionlimit(3000)
n,m =map(int,input().split())
pas = [[] for i in range(n+1)]
for i in range(m):
    a,b = map(int,input().split())
    pas[a].append(b)
    pas[b].append(a)

seen = [False for i in range(n)]
que = deque()
def bfn(i,j):
    if seen[i-1]==False:
        seen[i-1]=j
    for x in pas[i]:
        if seen[x-1]!=False:
            continue
        que.append([x,i])
    if que:
        now,pre =que.popleft()
        bfn(now,pre)
    else:
        return

bfn(1,1)

if False in seen:
    print("No")
else:
    print("Yes")
    for i in range(n-1):
        print(seen[i+1])


### FIXED CODE ###

from collections import deque
import sys
sys.setrecursionlimit(1000000)
n,m =map(int,input().split())
pas = [[] for i in range(n+1)]
for i in range(m):
    a,b = map(int,input().split())
    pas[a].append(b)
    pas[b].append(a)

seen = [False for i in range(n)]
que = deque()
def bfn(i,j):
    for x in pas[i]:
        if seen[x-1]!=False:
            continue
        seen[x-1]=i
        que.append([x,i])
    if que:
        now,pre =que.popleft()
        bfn(now,pre)
    else:
        return

bfn(1,1)

if False in seen:
    print("No")
else:
    print("Yes")
    for i in range(n-1):
        print(seen[i+1])
s = set(list(input()))
b = set(list("abcdefghijklmnopqrstuvwxyz"))

print(sorted(list(b-s))[0])

### FIXED CODE ###

s = set(list(input()))
b = set(list("abcdefghijklmnopqrstuvwxyz"))

l = sorted(list(b-s))

if l == []:
  print("None")
else:
  print(sorted(list(b-s))[0])
#!/usr/bin/python3
# -*- coding:utf-8 -*-

from collections import defaultdict
import sys
sys.setrecursionlimit(10**5+1)

def main():
  n, m = map(int, input().strip().split())
  memo = [-1] * (n+1)
  graph = defaultdict(list)

  for _ in range(m):
    x, y = map(int, input().strip().split())
    graph[y].append(x)

  def rec(v):
    if memo[v] != -1:
      return memo[v]

    memo[v] = max([0] + [rec(t)+1 for t in graph[v]])
    return memo[v]

  print(max([rec(v) for v in range(1, n+1)]))

if __name__=='__main__':
  main()

### FIXED CODE ###

#!/usr/bin/python3
# -*- coding:utf-8 -*-

from collections import defaultdict
import sys
sys.setrecursionlimit(10**7)

def main():
  n, m = map(int, input().strip().split())
  memo = [-1] * (n+1)
  graph = defaultdict(list)

  for _ in range(m):
    x, y = map(int, input().strip().split())
    graph[y].append(x)

  def rec(v):
    if memo[v] != -1:
      return memo[v]

    lp = 0
    for t in graph[v]:
      lp = max(lp, rec(t)+1)
    memo[v] = lp
    return memo[v]

  lp = 0
  for v in range(1, n+1):
    lp = max(lp, rec(v))
  print(lp)


if __name__=='__main__':
  main()
n,k=map(int,input().split())
a=list(map(lambda x:int(x)-1,input().split()))
lst=[0]
now=0
memo=0
town=[0]*n
town[0]=1
b=0 
for i in range(k):
  now=a[now]
  if town[now]==1:
    memo=now 
    b=1
    break
  lst.append(now)
  town[now]=1
if b==1:
    i=lst.index(now)　
    l=len(lst)
    if memo!=0:
      lst=lst[i:]
      l-=len(lst)
      print(lst[(k-l)%len(lst)]+1)
    else:
         print(lst[k%l]+1)
else:
  print(now+1)


### FIXED CODE ###

n,k=map(int,input().split())
a=list(map(lambda x:int(x)-1,input().split()))
lst=[0]
now=0
memo=0
town=[0]*n
town[0]=1
b=0
for i in range(k):
	now=a[now]
	if town[now]==1:
		memo=now
		b=1
		break
	lst.append(now)
	town[now]=1
if b==1:
	i=lst.index(memo)
	l=len(lst)
	if memo!=0:
		lst=lst[i:]
		l-=len(lst)
		print(lst[(k-l)%len(lst)]+1)
	else:
		print(lst[k%l]+1)
else:
	print(now+1)
N = int(input())
S = input()
if N%2 == 1: print("No")
elif S[:N/2] == S[N/2:] print("Yes")
else: print("No")

### FIXED CODE ###

N = int(input())
S = input()
if N%2 == 1: print("No")
else:
    n=int(N/2)
    if S[:n]==S[n:] :print("Yes")
    else:print("No")
# https://atcoder.jp/contests/abc070/tasks/abc070_c

from functools import reduce
import math
import sys
input = sys.stdin.readline
sys.setrecursionlimit(1000000)

# 最小公倍数を求める問題
# 参考：https://note.nkmk.me/python-gcd-lcm/
# 上記リンク先に最大公約数も載ってた

N = int(input())
T = []
for i in range(N):
    T.append(int(input()))

def lcm_base(x, y):
    x_y = x * y
    gcd_xy = math.gcd(x, y)
    ans = x_y // gcd_xy
    return ans

def lcm_list(list):
    return reduce(lcm_base, list, 1)

lcm = lcm_list(T)

print(lcm)


### FIXED CODE ###

N = int(input())
T = []
for i in range(N):
    T.append(int(input()))

def gcd(x, y):
    if x < y:
        x, y = y, x
    while x % y != 0:
        x, y = y, x % y
    return y


ans = T[0]
for i in range(1, N):
    ans *= T[i] // gcd(ans, T[i])

print(ans)
a = input()
b = input()
	print(((int(a) + int(b)) * 2))
	print((int(a) * int(b))

### FIXED CODE ###

a ,b = input().split(' ')
print(int(a) * int(b),(int(a) * 2) + (int(b) * 2))
S = include()
if S == 'Sunny':
    print('Cloudy')
    elif S == "Cloudy":
        print('Rainy')
    elif S =='Rainy':
        print('Sunny')
else
exit()

### FIXED CODE ###

import sys
S = input()
a = "Sunny"
b = 'Cloudy'
c = 'Rainy'
if S == a:
    print(b)
elif S == b:
        print(c)
elif S == c:
        print(a)
else:
    sys.exit()
sys.exit()
import math
X,Y = list(map(int,input().split()))
if X%3!=0 or Y%3!=0:
    print(0)
else:
    n = (2*Y - X)//3
    m = (2*X - Y)//3

a = math.factorial(n+m)
b = math.factorial(m)
c = math.factorial(n)
print((a//(b*c))%(7+10**9))

### FIXED CODE ###

X,Y = list(map(int,input().split()))
def nCk(n, k, mod=10 ** 9 + 7):
    if n < k:
        return 0
    k = min(k, n - k)
    numer = 1
    for x in range(n - k + 1, n + 1):
        numer = (numer * x) % mod
    denom = 1
    for x in range(1, k + 1):
        denom = (denom * x) % mod
    return numer * pow(denom, mod - 2, mod) % mod
if (X+Y)%3!=0:
    print(0)
else:
    n = (2*Y - X)//3
    m = (2*X - Y)//3
    if n<0 or m<0:
        print(0)
    else:
        print(nCk(n+m, m)%(7+10**9))
import numpy as np
from scipy.sparse.csgraph import minimum_spanning_tree
from scipy.sparse import csr_matrix, coo_matrix, lil_matrix

n=int(input())
l=[]
for i in range(n):
    l.append([i]+list(map(int,input().split())))
g = [[0 for j in range(n)]for i in range(n)]
l.sort(key=lambda x: x[1])
for i in range(n-1):
    p=l[i][0]
    q=l[i+1][0]
    if p<q:p,q=q,p
    g[p][q]= abs(l[i+1][1]-l[i][1])
l.sort(key=lambda x: x[2])
for i in range(n-1):
    p=l[i][0]
    q=l[i+1][0]
    if p<q:p,q=q,p
    if g[p][q] != 0:
        g[p][q] = min(g[l[i][0]][l[i+1][0]],abs(l[i+1][2]-l[i][2]))
    else:
        g[p][q] = abs(l[i+1][2]-l[i][2])
mst = minimum_spanning_tree(g)
print(int(mst.sum()))



### FIXED CODE ###

n=int(input())
l=[]
for i in range(n):
    l.append([i]+list(map(int,input().split())))
g = []
l.sort(key=lambda x: x[1])
for i in range(n-1):
    g.append([l[i][0],l[i+1][0],abs(l[i][1]-l[i+1][1])])
l.sort(key=lambda x: x[2])
for i in range(n-1):
    g.append([l[i][0],l[i+1][0],abs(l[i][2]-l[i+1][2])])

class UnionFind():
    def __init__(self, n):
        self.n = n
        self.parents = [-1] * n

    def find(self, x):
        if self.parents[x] < 0:
            return x
        else:
            self.parents[x] = self.find(self.parents[x])
            return self.parents[x]

    def union(self, x, y):
        x = self.find(x)
        y = self.find(y)

        if x == y:
            return

        if self.parents[x] > self.parents[y]:
            x, y = y, x

        self.parents[x] += self.parents[y]
        self.parents[y] = x

    def size(self, x):
        return -self.parents[self.find(x)]

    def same(self, x, y):
        return self.find(x) == self.find(y)

    def members(self, x):
        root = self.find(x)
        return [i for i in range(self.n) if self.find(i) == root]

    def roots(self):
        return [i for i, x in enumerate(self.parents) if x < 0]

    def group_count(self):
        return len(self.roots())

    def all_group_members(self):
        return {r: self.members(r) for r in self.roots()}

    def __str__(self):
        return '\n'.join('{}: {}'.format(r, self.members(r)) for r in self.roots())

def minimum_spanning_tree(g,n):
#g=list、「始点、終点、辺の重み」
#n=頂点数
    g.sort(key=lambda x: x[2])
    uf = UnionFind(n)
    ret = 0
    for sg in g:
        a,b,c = sg[0],sg[1],sg[2]
        if not uf.same(a,b):
            uf.union(a,b)
            ret += c
    return ret

print(minimum_spanning_tree(g,n))
#coding:utf-8
a = input()
b = input()
c = input()

if a*c <= b:
    print(c)
    print("高橋くんは8円以上持っているのでお気に入りの音を4回聞いて満足します。")

else:
    print(b/a)
    print("高橋くんが満足できないことがあります。")



### FIXED CODE ###

a,b,c = map(int,input().split())
num = int(b/a)

if num > c:
	print(c)

else:
	print(num)
n=int(input())
l=[map(int,input().split())]
l.sort()
ans=0
for i in range(0,n-2):
  for j in range(i+1,n-1):
    for k in range(j+1,n):
      if l[k]<l[i]+l[j]:
        ans+=1
        
print(ans)        
        


### FIXED CODE ###

import bisect
n=int(input())
l=list(map(int,input().split()))
l.sort()
ans=0
for i in range(0,n-1):
  for j in range(i+1,n):
    x=l[i]+l[j]
    y=bisect.bisect_left(l,x)-1
    ans+=max((y-j),0)
    
print(ans)
s=input()
if s.lowercase():
  print("A")
else:
  print("a")

### FIXED CODE ###

s=input()
if s.islower():
  print("a")
else:
  print("A")
N,Q=map(int,input().split())
S=input()
word_list=list(S)
for i in range(Q):
  count=0
  flag =0
  l,r=map(int,input().split())
  box=word_list[l-1:r]
  for i in box:
    if i == 'A':
      flag =1
    elif i!= 'C':
      flag=0
    if flag == 0 and i=='C':
      flag = 0
    if flag == 1 and i =='C':
      count += 1
      flag = 0
  print(count)

### FIXED CODE ###

word=input()
if word == 'A':
  print('T')
elif word == 'T':
  print('A')
elif word == 'G':
  print('C')
else:
  print('G')
K = int(input())
A,B = map(int, input())

if A%K==0 or B%K==0 or ABS(B-A)>=K:
  print('OK')
else:
  print('NG')

### FIXED CODE ###

K = int(input())
A,B = map(int, input().split())

for num in range(A, B+1, 1):
  if num % K == 0:
    print('OK')
    break
else:
  print('NG')
import sys
from collections import deque

read = sys.stdin.read
readline = sys.stdin.readline

N, *ab = map(int, read().split())
graph = [[] for _ in range(N + 1)]
for a, b in zip(*[iter(ab)] * 2):
    graph[a].append(b)
    graph[b].append(a)

k0 = list(range(3, N + 1, 3))
k1 = list(range(1, N + 1, 3))  # 1番多い
k2 = list(range(2, N + 1, 3))

start = ab[0]
color = 1  # 1が黒
queue = deque([(start, color)])
answer = [0] * (N + 1)
answer[start] = k1.pop()
while queue:
    V, c = queue.popleft()
    c = -c
    for v in graph[V]:
        if answer[v] == 0:
            if c == 1:
                if k1:
                    answer[v] = k1.pop()
                else:
                    answer[v] = k0.pop()
            else:
                if k2:
                    answer[v] = k2.pop()
                else:
                    answer[v] = k0.pop()
            queue.append((v, c))

print(' '.join(map(str, answer[1:])))


### FIXED CODE ###

import sys
from collections import deque

read = sys.stdin.read
readline = sys.stdin.readline

N, *ab = map(int, read().split())

if N == 2:
    print(1, 2)
    exit()

graph = [[] for _ in range(N + 1)]
for a, b in zip(*[iter(ab)] * 2):
    graph[a].append(b)
    graph[b].append(a)

k0 = list(range(3, N + 1, 3))
k1 = list(range(1, N + 1, 3))  # 1番多い
k2 = list(range(2, N + 1, 3))

start = ab[0]
color = 1  # 1が黒
queue = deque([(start, color)])
colors = [0] * (N + 1)
colors[start] = 1
while queue:
    V, c = queue.popleft()
    c = -c
    for v in graph[V]:
        if colors[v] == 0:
            colors[v] = c
            queue.append((v, c))

black = colors.count(1)
white = N - black
three = (N - 3) // 3 + 1
if black <= three:
    b = k0[:black]
    w = k1 + k2 + k0[black:]
    answer = [b.pop() if i == 1 else w.pop() for i in colors[1:]]
    print(' '.join(map(str, answer)))
elif white <= three:
    w = k0[:white]
    b = k1 + k2 + k0[white:]
    answer = [b.pop() if i == 1 else w.pop() for i in colors[1:]]
    print(' '.join(map(str, answer)))
else:
    answer = [0] * (N + 1)
    for i in range(1, N + 1):
        if colors[i] == 1:
            if k1:
                answer[i] = k1.pop()
            else:
                answer[i] = k0.pop()
        else:
            if k2:
                answer[i] = k2.pop()
            else:
                answer[i] = k0.pop()
    print(' '.join(map(str, answer[1:])))
import sys


def Sieve(N, AList):
    AList.sort()
    N_NotDivisible = 0
    while( len(AList) > 0 ):
        if(len(AList) > 1):
            if(AList[0]!= AList[1]):
                N_NotDivisible+= 1
                value = AList[0]
                AList.pop(0)
                AList = [ i for i in AList if i % value != 0 ]
            else:
                index = 1
                while(index < N and AList[0] == AList[index]):
                    index += 1
                Times = index+1
                for i in range(Times):
                    AList.pop(0)

        else:
            N_NotDivisible+= 1
            break
    #print(Mins)
    return N_NotDivisible

if(__name__ == "__main__"):

    N = int( input().strip() )
    AList_str = input().strip().split()

    AList = [0] * N
    for i in range(N):
        AList[i] = int(AList_str[i])
    N_NotDivisible= Sieve(N, AList)
    print(N_NotDivisible)


### FIXED CODE ###

import sys

def Sieve2(N, AList, Bools, Max_A):
    N_NotDivisible = 0
    value = 0
    for i in range(N):
        if(AList[i]>value):
            value = AList[i]
            if(Bools[value]==True):
                N_NotDivisible += 1

            for j in range(2, Max_A//value+1, 1 ):
                Bools[j*value] = False
    #print(Mins)
    return N_NotDivisible


if(__name__ == "__main__"):

    N = int( input().strip() )
    AList_str = input().strip().split()
    Max = 0
    AList = [0] * N
    for i in range(N):
        AList[i] = int(AList_str[i])
        Max = max(AList[i], Max)
    Bools = [False] * (Max+1)
    AList.sort()
    Dups = []
    for Num in range(N):
        value = AList[Num]
        Bools[value] = True
        if(Num < N-1 and AList[Num] == AList[Num+1]):
            Dups.append(value)
    for Num in range(len(Dups)):
        value = Dups[Num]
        Bools[value] = False


    N_NotDivisible= Sieve2(N, AList, Bools, Max)
    print(N_NotDivisible)
N, W = map(int, input().split())
w, v = [0] * N, [0] * N
for i in range(N):
	w[i], v[i] = map(int, input().split())

V = sum(v)
# dp[i][j]:i番目までの品物から価値がj以上になるよう選んだときの重さの総和の最小値
dp = [[float("inf")] * (V + 1) for _ in range(N + 1)]
dp[0][0] = 0
for i in range(N):
	for j in range(V + 1):
		# i+1番目を選ぶ場合
		if j - v[i] >= 0:
			dp[i + 1][j] = min(dp[i + 1][j], dp[i][j - v[i]] + w[i])
		# i+1番目を選ばない場合
		dp[i + 1][j] = min(dp[i + 1][j], dp[i][j])

# dp[N][j]がW以下であるようなjの最大値が答えになる
ans = 0
for j in range(V + 1):
	if dp[N][j] <= W:
		ans = j

print(ans)

### FIXED CODE ###

from sys import stdin
n,w = [int(x) for x in stdin.readline().rstrip().split()]
li = [list(map(int,stdin.readline().rstrip().split())) for _ in range(n)]
def knapsack(n,w,li):
    #li[i][0]が重さ,li[i][1]が価値
    dp = [[0 for i in range(w+1)]for j in range(n+1)]
    #dp[i][total_w]はi-1回目までの商品を加えた時に重さがtotal_wを超えないような値の最大値
    for i in range(n):
        for total_w in range(w+1):
            if total_w - li[i][0] >= 0:
                dp[i+1][total_w] = max(dp[i][total_w],dp[i][total_w-li[i][0]]+li[i][1])
            else:
                dp[i+1][total_w] = dp[i][total_w]
    return max(dp[-1])
print(knapsack(n,w,li))
a,b=(int(x) for x in input().split())

if a<10 and b<10:
	print(a*b)
else::
	print("-1")

### FIXED CODE ###

a,b=(int(x) for x in input().split())

if a<10 and b<10:
	print(a*b)
else:
	print("-1")
ans=[]
n=int(raw_input())
while n:
    n-=1
    s=map(str,raw_input().split())
    if s[0][0]=='i':
        ans.insert(0,s[1])
    elif s[0][-3]=='r':
        ans.pop(0)
    elif s[0][-3]=='a':
        ans.pop()
    else:
        for i,j in enumerate(ans):
            if j==s[1]:
                ans.pop(i)
                break
print ' '.join(i)

### FIXED CODE ###

import sys
import collections
n=int(raw_input())
ans=collections.deque()
while n:
    n-=1
    s=sys.stdin.readline().rstrip().split(' ')
    if s[0][0]=='i':
        ans.appendleft(s[1])
    elif s[0][-3]=='r':
        ans.popleft()
    elif s[0][-3]=='a':
        ans.pop()
    else:
        try:
            ans.remove(s[1])
        except:
            pass
sys.stdout.write(' '.join(ans))
print
S = input()
print(S[0])
if len(set((S[0], S[1], S[2]))) == 3:
    print("Yes")
else:
    pritn("No")



### FIXED CODE ###

S = input()
if len(set((S[0], S[1], S[2]))) == 3:
    print("Yes")
else:
    print("No")
def sample_code(N):

 #   print('Prime factor')
    fct = factorize(N)
 #   print(fct,num(fct))

 #   print('divisor')
    for div in divisorize(fct):
        continue
 #       print(div,num(div))


def divisorize(fct):
    b,e = fct.pop()
    pre_div = divisorize(fct) if fct else [[]]
    suf_div = [[(b,k)] for k in range(e + 1)]
    return [pre + suf for pre in pre_div for suf in suf_div]

def factorize(N):
    fct = []
    b,e = 2, 0
    while b * b <= N:
        while N % b == 0:
            N = N // b
            e = e + 1
        if e > 0:
            fct.append((b,e))
        b,e = b + 1,0
    if N > 1:
        fct.append((N,1))
    return fct

def num(fct):
    a = 1
    for base, exponent in fct:
        a = a * base ** exponent
        divisor_list.append(a)
    return a

N = int(input())
sum_m = 0
divisor_list = []
sample_code(N)
divisor_list = list(set(divisor_list))

for c in divisor_list:
    if c != 1 and c!= 2:
        if N // (c-1) >= (c-1):
            continue
        else:
            sum_m += c - 1

print(sum_m)

### FIXED CODE ###

def sample_code(N):

 #   print('Prime factor')
    fct = factorize(N)
 #   print(fct,num(fct))

 #   print('divisor')
    for div in divisorize(fct):
        b = num(div)


def divisorize(fct):
    b,e = fct.pop()
    pre_div = divisorize(fct) if fct else [[]]
    suf_div = [[(b,k)] for k in range(e + 1)]
    return [pre + suf for pre in pre_div for suf in suf_div]

def factorize(N):
    fct = []
    b,e = 2, 0
    while b * b <= N:
        while N % b == 0:
            N = N // b
            e = e + 1
        if e > 0:
            fct.append((b,e))
        b,e = b + 1,0
    if N > 1:
        fct.append((N,1))
    return fct

def num(fct):
    a = 1
    for base, exponent in fct:
        a = a * base ** exponent
        divisor_list.append(a)
    return a

N = int(input())
sum_m = 0
divisor_list = []
if N == 1:
    print(0)
else:
    sample_code(N)
    divisor_list = list(set(divisor_list))

    for c in divisor_list:
        if c != 1 and c!= 2:
            if N // (c-1) >= (c-1):
                continue
            else:
                sum_m += c - 1

    print(sum_m)