Harryxun/stf_run huggingface dataset:
a = raw_input()
d = {}
for i in "abcdefghijklmnopqrstuvwxyz":
    d[i] = 0
for i in a:
    d[i] += 1
for i in "abcdefghijklmnopqrstuvwxyz":
    print i,':',d[i]

### FIXED CODE ###

import sys

a = []
for line in sys.stdin:
    a.append(str(line))
a = ''.join(a).lower()

d = {}
for i in "abcdefghijklmnopqrstuvwxyz":
    d[i] = 0
for i in a:
    if i in "abcdefghijklmnopqrstuvwxyz":
        d[i] += 1
for i in "abcdefghijklmnopqrstuvwxyz":
    print i,':',d[i]
n,m = map(int,input().split())

up = [[] for i in range(n)]
down= [[]for i in range(n)]
for i in range(n+m-1):
    a,b = map(int,input().split())
    a -=1
    b -=1
    up[b].append(a)
    down[a].append(b)

res = [-1]*n
root = -1

for i in range(n):
    if len(up[i])==0:
        res[i] = 0
        root = i
        break

#0なら不使用
used = [0]*n
used[root]=1

#yの親に不使用が一つも存在しなければTrue
def g(y):
    for pe in up[y]:
        if used[pe]==0:
            return False
    return True
    
#zの下のusedとresを埋める
def f(z):
    global used
    global res
    for i in range(len(down[z])):
        if used[down[z][i]]==0 and g(down[z][i]):
            used[down[z][i]]=1
            res[down[z][i]]=z+1
            f(down[z][i])
f(root)
for i in range(n):
    print(res[i])


### FIXED CODE ###

from collections import deque

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

up = [[] for i in range(n)]
down= [[]for i in range(n)]
for i in range(n+m-1):
    a,b = map(int,input().split())
    a -=1
    b -=1
    up[b].append(a)
    down[a].append(b)

res = [-1]*n
root = -1

for i in range(n):
    if len(up[i])==0:
        res[i] = 0
        root = i
        break

#0なら不使用
used = [0]*n
used[root]=1

#yの親に不使用が一つも存在しなければTrue
def g(y):
    for pe in up[y]:
        if used[pe]==0:
            return False
    return True
    
#zの下のusedとresを埋める
def f(z):
    for e in down[z]:
        if used[e]==0 and g(e):
            res[e]=z+1
            tank2.append(e)
            usedtank.append(e)
c = 1
tank = deque([root])
tank2 = deque([root])
usedtank = []
while c != n:
    tank = tank2
    tank2 = deque([])
    usedtank = []
    while len(tank)!=0:
        f(tank.popleft())
    for usede in usedtank:
        used[usede]=1
    c += len(tank2)
    
for i in range(n):
    print(res[i])
# coding: utf-8
x,y,z = list(map(int, input().split()))

print(f'{z} {x} {y}')

### FIXED CODE ###

# coding: utf-8
x,y,z = list(map(int, input().split()))

print('{} {} {}'.format(z,x,y))
n=int(input())
h=list(map(int,input().split()))
dp=[0]*n
dp[0]=0
dp[1]=abs(h[1]-h[0])
for i in range(2,n):dp[i]=min(dp[i-1]+abs(h[i]-h[i-1]),dp[i-2]+abs(h[i]-h[i-2]))print(dp[n-1])

### FIXED CODE ###

n=int(input())
h=list(map(int,input().split()))
dp=[0]*n
dp[0]=0
dp[1]=abs(h[1]-h[0])
for i in range(2,n):dp[i]=min(dp[i-1]+abs(h[i]-h[i-1]),dp[i-2]+abs(h[i]-h[i-2]))
print(dp[n-1])
s = input()
print(c.split(,))

### FIXED CODE ###

print(*input().split(","))
import sys
input = sys.stdin.readline
LOCAL = len(sys.argv) > 1 and sys.argv[1] == 'LOCAL'


def dprint(*args):
  if LOCAL:
    print(*args)


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

k -= x.count(0)

if k <= 0:
  print(0)
  exit()

n = [0]
for e in reversed(x):
  if e < 0:
    n.append(-e)

p = [0]
for e in x:
  if e > 0:
    p.append(e)


dprint(n, p)

anses = []

for i in range(k + 1):
  j = k - i
  if i == 0:
    pass
  elif 0 <= i < len(p) and 0 <= j < len(n):
    anses.append(p[i] * 2 + n[j])
    anses.append(p[i] + n[j] * 2)

dprint(anses)

print(min(anses))


### FIXED CODE ###

import sys
input = sys.stdin.readline
LOCAL = len(sys.argv) > 1 and sys.argv[1] == 'LOCAL'


def dprint(*args):
  if LOCAL:
    print(*args)


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

k -= x.count(0)

if k <= 0:
  print(0)
  exit()

n = [0]
for e in reversed(x):
  if e < 0:
    n.append(-e)

p = [0]
for e in x:
  if e > 0:
    p.append(e)


dprint(n, p)

anses = []

for i in range(k + 1):
  j = k - i
  if 0 <= i < len(p) and 0 <= j < len(n):
    anses.append(p[i] * 2 + n[j])
    anses.append(p[i] + n[j] * 2)

dprint(anses)

print(min(anses))
n = input()
number_list = map(int, input().split())

count = 1
even = True

while even:
    for i, a in enumerate(number_list):
        if a % 2 != 0:
            even = False
        else:
            number_list[i] = a / 2
    if even:
        count += 1
print(count)


### FIXED CODE ###

a = list(input())
print(a.count('1'))
import numpy as np
n=int(input())
a=list(np.fromstring(input(),int,sep=' '))
a_=list(set(a))
dic={}
ans={}
for i in a_:
    dic[i]=a.count(i)
    
def check(x):
    lst_=lst
    count=0
    ans=0
    dic_=dic
    for i in a_:
        if x==i:
            dic_[x]-=1
            break
    for i in dic_.values():
        ans+=i*(i-1)//2
    dic_[x]+=1
    return ans

for i in a_:
    ans[i]=check(i)

for i in a:
    print(ans[i])

### FIXED CODE ###

import numpy as np
import collections
n=int(input())
a=list(np.fromstring(input(),int,sep=' '))
dic=collections.Counter(a)
ans=0

for i in dic.values():
    ans+=i*(i-1)//2
    
for i in range(n):
    print(ans-(dic[a[i]]-1))
a=input().strip().split(" ")

if(a[1]=="+"):
    print(a[0]+a[2])
else:
    print(a[0]-a[2])
    


### FIXED CODE ###

a=input().strip().split(" ")

a[0]=int(a[0])
a[2]=int(a[2])


if(a[1]=="+"):
    print(a[0]+a[2])
else:
    print(a[0]-a[2])
lis = [0,0,0,0]
for n,m in lis(map(int,input().split())):
  lis[n-1] += 1
  lis[m-1] += 1
if 3 in lis:
  print("NO")
else:
  print("YES")

### FIXED CODE ###

lis = [0,0,0,0]
for _ in range(3):
  n,m = list(map(int,input().split()))
  lis[n-1] += 1
  lis[m-1] += 1
if 3 in lis:
  print("NO")
else:
  print("YES")
####################
def pri(n):
  i = 2
  X = {}
  while i * i <= n:
    while n % i == 0:
      n /= i
      if i in X:
        X[i] = X[i] + 1
      else:
        X[i] = 1
    i += 1
  if n > 1:
    X[n] = 1
  return X
####################


N,X = list(map(int, input().split()))

x = list(map(int, input().split()))
x.append(X)

x.sort()

d = []
for i in range(N):
  dif = x[i+1] - x[i]
  if dif not in d:
    d.append(dif)

d.sort()

if len(d) == 1:
  print(d[0])
  exit()

min = d[0]
P = pri(d[0])

for i in range(1,len(d)):
  if d[i] % min != 0:
    t = pri(d[0])
    min = 1
    for j in P:
      if j in t:
        P[j] = min(P[j], t[j])
        min *= j ** P[j]
      else:
        del P[j]

print(min)


### FIXED CODE ###

####################
def pri(n):
  i = 2
  X = {}
  while i * i <= n:
    while n % i == 0:
      n /= i
      if i in X:
        X[i] = X[i] + 1
      else:
        X[i] = 1
    i += 1
  if n > 1:
    X[n] = 1
  return X
####################


N,X = list(map(int, input().split()))

x = list(map(int, input().split()))
x.append(X)

x.sort()

d = []
for i in range(N):
  dif = x[i+1] - x[i]
  if dif not in d:
    d.append(dif)

d.sort()

if len(d) == 1:
  print(d[0])
  exit()

m = d[0]
P = pri(d[0])

for i in range(1,len(d)):
  if d[i] % m != 0:
    t = pri(d[i])
    m = 1
    for j in list(P):
      if j in t:
        P[j] = min(P[j], t[j])
        m *= j ** P[j]
      else:
        del P[j]

print(int(m))
<?php
//https://stackoverflow.com/questions/5506888/permutations-all-possible-sets-of-numbers

function pc_permute($items, $perms = array( )) {
    if (empty($items)) {
        // もう取り出すものがなければその時点の$permsが順列の一つなのでそのまま返却 
        $return = array($perms);
    } else {
        $return = array();
        // 並んでる数字を順番にみてく
        for ($i =  0; $i < count($items); $i++) {
            // 処理対象の配列と、組み合わせを保持してる変数を別変数にコピー
            // array_spliceなどは破壊的なメソッドなので退避しないと元配列が変更される
            $newitems = $items;
            $newperms = $perms;
            // インデックスが$iの値を$fooにとる。($newitemsからは削除される)
            list($foo) = array_splice($newitems, $i, 1);
            // 取り除いた値（$foo)を組み合わせの候補の先頭に持ってくる
            array_unshift($newperms, $foo);
            // 最終的に呼び出し元に返却する配列に追加する
            // 追加する配列は、一文字削ったあとの$newitems,
            // 現段階での組み合わせの$newpermsを引数に、再帰的に自分を呼び出した結果
            $return = array_merge($return, pc_permute($newitems, $newperms));
        }
    }
    return $return;
}

// ----------------------------------------------------
// こっから実際に解く
// ----------------------------------------------------

// 入力値の取得（int変換)
$N = intval(trim(fgets(STDIN)));
// 入力値の取得（配列化）
$P = explode(" ",fgets(STDIN));
$Q = explode(" ",fgets(STDIN));

// 順列の生成
$a = range(1,$N);
$perms = pc_permute($a);
sort($perms);

$p_index = -1;
$q_index = -1;

// 列挙した順列をfor文で確認していき、PとQの位置を確認する
for ($i=0; $i < count($perms); $i++){
  if ($perms[$i] == $P){
    $p_index = $i;
  }
  if ($perms[$i] == $Q){
    $q_index = $i;
  }
}

// 答えの計算
$ans = abs($p_index - $q_index);
printf("%d\n",$ans);


### FIXED CODE ###

import itertools

def main():
    N = int(input())
    
    P = list(map(int, input().split()))
    Q = list(map(int, input().split()))
    
    combi = list(itertools.permutations(range(1, N+1)))
    
    pi = 0
    qi = 0
    for i in range(len(combi)):
        if list(combi[i]) == P:
            pi = i + 1
        if list(combi[i]) == Q:
            qi = i + 1
            
            
    print(abs(qi - pi))
    
main()
processedIp = input.split(' ')
k = int(processedIp[0])
x = int(processedIp[1])
totalValue = k*500
if (totalValue >= x):
    print("Yes")
else:
    print("No")

### FIXED CODE ###

processedIp = input().split(" ")
k = int(processedIp[0])
x = int(processedIp[1])
totalValue = k*500
if (totalValue >= x):
    print("Yes")
else:
    print("No")
N = input()
a = []
for i in range(N):
    a.append(input())
b = [0, 0, 0]
for i in a:
	j = 0
	while j < 3:
		if i > b[j]:
			b.insert(j, i)
			break
		j += 1

for i in b[:3]:
	print i

### FIXED CODE ###

import sys

a = []
for line in sys.stdin:
    a.append(int(line))
b = [0, 0, 0]
for i in a:
	j = 0
	while j < 3:
		if i > b[j]:
			b.insert(j, i)
			break
		j += 1

for i in b[:3]:
	print i
from sys import stdin
input = stdin.readline

a,b,n = map(int,input().split())
maxpoint = 0

if b > n :
    for i in range(n+1):
        tmp = int((a * i) / b)  - a * int(i/b) 
        maxpoint = max(tmp,maxpoint)
       
        
else:
    for i in reversed(range(n+1)):
        c += 1
        tmp = int((a * i) / b)  - a * int(i/b) 
        if b > 1:
            if i % (b-1) == 0 :
                maxpoint = max(tmp,maxpoint)
                print(maxpoint) 
                exit()
        elif b == 1:
            print(0)
            exit()
        maxpoint = max(tmp,maxpoint)

print(maxpoint)


### FIXED CODE ###

from sys import stdin
input = stdin.readline
 
a,b,n = map(int,input().split())
maxpoint = 0
 
if b > n  :
    tmp = int((a * n) / b)  - a * int(n/b) 
    maxpoint = max(tmp,maxpoint)
else:
    k = int(n/b)*b -1
    maxpoint =  int((a * k) / b)  - a * int(k/b) 
    if b == 1:
        maxpoint = 0
 
print(maxpoint)
print {(0,0):'NA', (0,1): 'YYMM', (1,0): 'MMYY', (1,1):'AMBIGUOUS'}[tuple(map(int,list(tuple([(0<int(s[2*i:2*i+2]) <= 12)	for i in range(2)]))))]

### FIXED CODE ###

def f(s):
  m,y = int(s[:2]), int(s[2:])
  return 0< m <= 12

def g(s):
  y,m = int(s[:2]), int(s[2:])
  return 0< m <= 12
    
s = raw_input()
p,q = f(s), g(s)

if p and q:
  print 'AMBIGUOUS'
elif p and not(q):
  print 'MMYY'
elif q and not(p):
  print 'YYMM'
else:
  print 'NA'
money = int(input())
six = 1
nine = 1
now = 1
kingaku = [1]
while money > now:
    if pow(6,six) < pow(9,nine):
        now = pow(6,six)
        six += 1
    else:
        now = pow(9,nine)
        nine += 1
    kingaku.append(now)
kingaku.pop()
count = 0
def check(money, lis, idx, count):
    m = lis[idx]
    if money < 0:
        return 1000000
    if idx < 0:
        return count
    if idx == 0:
        return count + money
    if money < m:
        return check(money, lis, idx-1, count)
    sho = money // m
    mini = 1000000
    for i in range(sho + 1):
        value = check(money-m*i, lis, idx-1, count+i)
        if value < mini:
            mini = value
    return mini
print(check(money, kingaku, len(kingaku)-1, 0))

### FIXED CODE ###

n = int(input())

r = n

for i in range(n+1):
    cnt = 0
    nine = n - i
    while i > 0:
        cnt += i % 6
        i = i // 6
    while nine > 0:
        cnt += nine % 9
        nine = nine // 9
    if r > cnt: r = cnt

print(r)
import functools
import math
import copy

n=int(input())
a=list(map(int,input().split()))
ans=0
for i in range(n):
    l=copy.copy(a)
    del l[i]
    gcd=functools.reduce(math.gcd, l)
    if ans<gcd:
        ans=gcd
print(ans)


### FIXED CODE ###

import fractions
n=int(input())
a=list(map(int,input().split()))
l=[a[0]]
r=[a[-1]]
for i in range(n-1):
  l.append(fractions.gcd(l[i],a[i+1])) #l[i] は最初i個
for i in range(n-1):
  r.append(fractions.gcd(r[i],a[-2-i])) #r[i]は右i r[n-1]=全部 l[0]and r[n-3]
m=[l[n-2],r[n-2]]
for i in range(n-2):
  m.append(fractions.gcd(l[i],r[n-i-3]))
print(max(m))
#!/usr/bin/env python3
 
import sys
import math
from bisect import bisect_right as br
from bisect import bisect_left as bl
from collections import defaultdict
from itertools import accumulate
from collections import Counter
from collections import deque
from operator import itemgetter
from itertools import permutations
mod = 10**9 + 7
inf = float('inf')
def I(): return int(sys.stdin.readline())
def LI(): return list(map(int,sys.stdin.readline().split()))
 
n = I()
a = LI()

for i in range(n):
    if a[i] > 2**i - 1:
        print(-1)
        quit()
if a[-1] > 2**(n+1):
    print(-1)
    quit()
if n == 0:
    if a[0] == 1:
        print(0)
        quit()
    else:
        if a[1] == 2:
            print(3)
            quit()
        elif a[1] == 1:
            print(2)
            quit()
lst = [1]
for i in range(1, n+1):
    l = lst[-1] - a[i-1]
    if l <= 0:
        print(-1)
        quit()
    lst.append(2*l)
i = n-1
tmp = a[-1]
ans = 0
lst2 = [a[-1]]
while i >= 0:
    tmp += a[i]
    tmp = min(tmp, 2**i)
    lst2.append(tmp)
    i -= 1
lst2 = lst2[::-1]
for i in range(n+1):
    ans += min(lst[i], lst2[i])
print(ans)

### FIXED CODE ###

#!/usr/bin/env python3
 
import sys
import math
from bisect import bisect_right as br
from bisect import bisect_left as bl
from collections import defaultdict
from itertools import accumulate
from collections import Counter
from collections import deque
from operator import itemgetter
from itertools import permutations
mod = 10**9 + 7
inf = float('inf')
def I(): return int(sys.stdin.readline())
def LI(): return list(map(int,sys.stdin.readline().split()))
 
n = I()
a = LI()
if n == 0:
    if a[0] == 1 or a[0] == 0:
        print(1)
        quit()
    else:
        print(-1)
        quit()
for i in range(n):
    if a[i] > 2**i - 1:
        print(-1)
        quit()
if a[-1] > 2**n:
    print(-1)
    quit()

lst = [1]
for i in range(1, n+1):
    l = lst[-1] - a[i-1]
    if l <= 0:
        print(-1)
        quit()
    lst.append(2*l)
if lst[-1] - a[-1] < 0:
    print(-1)
    quit()

i = n-1
tmp = a[-1]
ans = 0
lst2 = [a[-1]]
while i >= 0:
    tmp += a[i]
    tmp = min(tmp, 2**i)
    lst2.append(tmp)
    i -= 1
lst2 = lst2[::-1]
for i in range(n+1):
    ans += min(lst[i], lst2[i])
print(ans)
x = [int(x) for x in input().split()]
y = [int(x) for x in input().split()]
c=0
for i in range(x[0]):
  if y[i]>=x[1]:
    c++
print(c)

### FIXED CODE ###

x = [int(x) for x in input().split()]
y = [int(x) for x in input().split()]
c=0
for i in range(x[0]):
  if y[i]>=x[1]:
    c+=1
    continue
print(c)
#参考：https://marco-note.net/abc-174-work-log/
n = int(input())
c = input()

R.count('R')
cnt = 0

for i in range(R):
    if R[i]=="R":
        cnt += 1
print(R-cnt)


### FIXED CODE ###

#参考：https://marco-note.net/abc-174-work-log/
n = int(input())
c = input()

R=c.count('R')
cnt = 0

for i in range(R):
    if c[i]=="R":
        cnt += 1
print(R-cnt)
def main():
  import sys
  from numpy import zeros
  input=sys.stdin.buffer.readline
  n=int(input())+1
  #data=zeros((n*2,26),int)
  data=[zeros(26,int)for _ in range(26)]
  def update(i,x):
    i+=n
    d=data[i]
    d[:]=0
    d[x]=1
    i//=2
    while i:
      data[i]=data[i*2]|data[i*2+1]
      i//=2
  def query(l,r):
    l+=n
    r+=n
    s=zeros(26,int)
    while l<r:
      if l&1:
        s|=data[l]
        l+=1
      if r&1:
        r-=1
        s|=data[r]
      l//=2
      r//=2
    return s.sum()
  for i,c in enumerate(input()[:-1],n):data[i][c-97]=1
  for i in range(n-1,0,-1):data[i]=data[i*2]|data[i-~i]
  s=[]
  for _ in range(int(input())):
    q,a,b=input().split()
    if q[0]>49:s+=query(int(a)-1,int(b)),
    else:update(int(a)-1,b[0]-97)
  print('\n'.join(map(str,s)))
main()

### FIXED CODE ###

import sys
input=sys.stdin.buffer.readline
n=int(input())+1
data=[0]*n*2
def update(i,x):
  i+=n
  data[i]=x
  i//=2
  while i:
    data[i]=data[i*2]|data[i*2+1]
    i//=2
def query(l,r):
  l+=n
  r+=n
  s=0
  while l<r:
    if l&1:
      s|=data[l]
      l+=1
    if r&1:
      r-=1
      s|=data[r]
    l//=2
    r//=2
  return sum(map(int,bin(s)[2:]))
for i,c in enumerate(input()[:-1]):
  update(i,2**(c-97))
for _ in range(int(input())):
  q,a,b=input().split()
  if q[0]>49:print(query(int(a)-1,int(b)))
  else:update(int(a)-1,2**(b[0]-97))
t = []
print(max(t))

### FIXED CODE ###

n = int(input())
xy = []
ans = []

for i in range(n):
    xin,yin = map(int,input().split())
    xy.append([xin,yin])

if n==1:
    print(1)
    exit(0)

xy.sort(key=lambda x:x[1])
xy.sort(key=lambda x:x[0])

for i in range(n):
    for j in range(n):
        if( i==j ):
            continue
        t = (xy[i][0]-xy[j][0],xy[i][1]-xy[j][1])
        ans.append(t)

res = [ans.count(e) for e in set(ans)]
print(n-max(res))
s = input()
t = input()
ans = 0

for i in range(s):
  ans += s[i] == t[i]

print(ans)

### FIXED CODE ###

s = input()
t = input()
ans = 0

for i in range(3):
  ans += s[i] == t[i]

print(ans)
n = int(input())
x = int(input(),2)
bitx = bin(x).count('1')

ans = [0]*(bitx+1)
for i in range(1,bitx+1):
    ans[i] = 1 + ans[i%bin(i).count('1')]
#print(ans)
l = []
if bitx != 1:
    for i in range(n):
        y = x^(1<<(n-i-1))
        if y>>(n-i-1)&1:
            l.append(str(1+ans[y % bitx+1]))
        else:
            l.append(str(1+ans[y % bitx-1]))
else:
    for i in range(n):
        y = x^(1<<(n-i-1))
        if y>>(n-i-1)&1:
            l.append(str(1+ans[y % bitx+1]))
        else:
            l.append(str(0))
    #print(1+ans[t])
print('\n'.join(l))

### FIXED CODE ###

n = int(input())
X = input()
x = int(X,2)
bitx = bin(x).count('1')
 
ans = [0]*(bitx+2)
for i in range(1,bitx+2):
    ans[i] = 1 + ans[i%bin(i).count('1')]
#print(ans)
l = []
bitp = bitx + 1
bitm = bitx - 1
xmp = 0
xmm = 0


if bitx != 1:
    for i in range(n):
        if X[i] == '1':
            xmp += pow(2, n-(i+1), bitp)
            xmm += pow(2, n-(i+1), bitm)
    for i in range(n):
        if X[i] == '1':
            xm = (xmm - pow(2,n-i-1,bitm)) % bitm
            l.append(str(1+ans[xm]))
        else:
            xm = (xmp + pow(2,n-i-1,bitp))%bitp
            l.append(str(1+ans[xm]))
 
else:
    for i in range(n):
        if X[i] == '1':
            xmp += pow(2, n-(i+1), bitp)
    for i in range(n):
        if X[i] == '1':
            l.append(str(0))
        else:
            xm = (xmp + pow(2,n-i-1,bitp))%bitp
            l.append(str(1+ans[xm]))
 
print('\n'.join(l))
x = [int(input()) for i in range(5)]

for i in range(5):
    if x[i]==0:
        print(i)

### FIXED CODE ###

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

for i in range(5):
    if x[i]==0:
        print(i+1)
n, *A = map(int, open(0).read().split())
c = [0]*9
for a in A:
  c[min(8, a//400)] += 1

print(c)
cmin = max(1, 8-[c::-1].count(0))
cmax = min(8, cmin+c[8])
print(cmin, cmax)

### FIXED CODE ###

n, *A = map(int, open(0).read().split())
c = [0]*9
for a in A:
  c[min(8, a//400)] += 1

cl = 8-c[:-1].count(0)
cmin = max(1, cl)
cmax = cl+c[8]
print(cmin, cmax)
n,x,=map(int, input().split())
w_list = list(map(int, input().split()))
 
d=0
for i in range(n+1):
   d=d+w_list[i]
   if(d>x):
       break
print(i+1)

### FIXED CODE ###

n,x = map(int,input().split())
li = list(map(int,input().split()))
 
ans = 1
now = 0
 
for i in li:
    now += i
    if now <= x:
        ans += 1
    else:
        break
 
print(ans)
import numpy as np

def countCombinations(n, x, size=3):
    dp = np.zeros((x + 1, size + 1), dtype=int)
    dp[0][0] = 1
    for i in range(1, n + 1):
        dp[i:, 1:] += dp[:-i, :-1]
        print(dp)
    return dp[-1, -1]

while True:
    m, n = (int(x) for x in input().split())
    if m==0 and n==0:
        quit()
    ans = countCombinations(m, n)
    print(ans)


### FIXED CODE ###

def countCombinations(n, x, size=3):
    dp = [[0 for j in range(x + 1)] for i in range(size + 1)]
    dp[0][0] = 1
    for i in range(1, n + 1):
        for row in range(size - 1, -1, -1):
            for col in range(x + 1 - i):
                dp[1+row][i+col] += dp[row][col]
    return dp[-1][-1]

while True:
    m, n = (int(x) for x in input().split())
    if m==0 and n==0:
        quit()
    print(countCombinations(m, n))
P8, P10 = map(int, input().split())

import math


price1_min = math.floor(P8/0.08)

price1_max = math.floor((P8+1)/0.08)-1

price2_min = math.floor(P10/0.10)

price2_max = math.floor((P10+1)/0.10)-1



if (price1_max >= price2_min) and (price2_max >= price1_min):
    print(max(price2_min, price1_min))
else: 
    print(-1)

### FIXED CODE ###

stations = input()
if (not "A" in stations) or (not "B" in stations):
  print("No")
else:
  print("Yes")
N = int(input())
a = [int(i) for i in input().split()]
s_sort = sorted(a, reverse=True)
score = 0
for i in range(1, 3N, 2):
    score += s_sort[i]
print(score)

### FIXED CODE ###

N = int(input())
a = [int(i) for i in input().split()]
s_sort = sorted(a, reverse=True)
score = 0
for i in range(1, 2*N, 2):
    score += s_sort[i]
print(score)
inp = input().split()
n,k = int(inp[0]),int(inp[1])
a = [int(x) for x in input().split()]
a.sort()
ans =0
for ini in range(0,n-k+1):
  for end in range(ini+k-1,n):
    m = end-ini-1
    r = k-2
    combi = math.factorial(m) // (math.factorial(m - r) * math.factorial(r))
    ans += (a[end]-a[ini])*combi

ans = ans % (10**9+7)
print(ans)

### FIXED CODE ###

abc='abcdefghijklmnopqrstuvwxyz'
x=input()
print(abc[abc.index(x)+1])
N=int(input())
temp=input().split()
A=[int(temp[i]) for i in range(N)]

A=[A[-1]]+A[:-1]

for i in range(N):
  print(mean(A[i:i+2]))

### FIXED CODE ###

N=int(input())
temp=input().split()
A=[int(temp[i]) for i in range(N)]
As=[]
As.append(sum([A[i]*pow(-1, i) for i in range(N)]))
for i in range(1, N):
  As.append(A[i-1]-As[i-1])

x1=As[0]/2
print(int(2*x1), end=' ')

for i in range(1, N):
  print(2*int(As[i]-x1*pow(-1, i)), end=' ')
s = input()
print(s.coumt("1"))

### FIXED CODE ###

s = input()
print(s.count("1"))
count = 1
while(1):
  x = int(raw_input())
  if x == 0:
    break
  print 'Case {0}: {1}'.format(count, x)
  count++

### FIXED CODE ###

count = 1
while 1:
  x = int(raw_input())
  if x == 0:
    break
  print 'Case {0}: {1}'.format(count, x)
  count += 1
import sys
import math

str = sys.stdin.readlines()

a = int(str[0].split()[0])
b = int(str[0].split()[1])

print(int(a * b / math.gcd(a,b)))



### FIXED CODE ###

import sys
import fractions

str = sys.stdin.readline()

a = int(str.split()[0])
b = int(str.split()[1])

print((a * b) // fractions.gcd(a,b))
num_list = input().split()

i = 0
while True:
    if num_list[i] == 0:
        print(i + 1)
        break
    i += 1

### FIXED CODE ###

num_list = input().split()

i = 0
while True:
    if int(num_list[i]) == 0:
        print(i + 1)
        break
    i += 1
def circle(r):
  return r**2

str = input()
print(circle(str))

### FIXED CODE ###

def circle(r):
    return r**2
str = int(input())
print(circle(str))
p,q,r=map(int,input().split())
print(p+q+r-max[p,q,r])

### FIXED CODE ###

p,q,r=map(int,input().split())
print(p+q+r-max([p,q,r]))
t=[int(input()) for _ in range(5)]
s=[]
for i in range(5):
    s.append(t[i]%10)
    t[i]=-(-t[i]//10)*10
S=sorted(s)[-5+s.count(0)]
if S==0:
    print(sum(t))
else:print(sum(t-10+S))

### FIXED CODE ###

t=[int(input()) for _ in range(5)]
s=[]
for i in range(5):
    s.append(t[i]%10)
    t[i]=-(-t[i]//10)*10
S=sorted(s)[-5+s.count(0)]
if S==0:
    print(sum(t))
else:print(sum(t)-10+S)