Harryxun/stf_run huggingface dataset:
N = int(input())
S_list = []
for i in range(N):
  S_list.append(input())

sorted(S_list)
name_list = []
vote_list = []
i, j = 0
while i < len(S_list):
  name = S_list[i]
  while j < len(S_list) and S_list[j] == name:
    j += 1
  name_list.append(name)
  vote_list.append(j - i)
  i = j
max_vote = max(vote_list)
for k in range(name_list):
  if vote_list[k] == max_vote:
    print (name_list[k])

### FIXED CODE ###

N = int(input())
S = {}
name_list = []
for i in range(N):
  name = input()
  if name not in S:
    S[name] = 1
    name_list.append(name)
  else:
    S[name] += 1
name_list = sorted(name_list)
max_vote_name = []
max_vote = -float('inf')
for name in name_list:
  if S[name] > max_vote:
    max_vote = S[name]
    max_vote_list = [name]
  elif S[name] == max_vote:
    max_vote_list.append(name)
for name in max_vote_list:
  print (name)
def GCD(x,y):
    if y==0:
        return x
    return GCD(y,x%y)


N, M = map(int,input().split())
A = list(map(int,input().split()))
ans = 1
for i in A:
    ans = (ans*(i//2))//GCD(ans,i)
    if ans%2 == 0:
        ans = 0
print(M//ans-M//(ans*2))

### FIXED CODE ###

def GCD(x,y):
    if y==0:
        return x
    return GCD(y,x%y)
def LCM(x,y):
    return x*y // GCD(x,y)
N, M = map(int,input().split())
A = list(map(int,input().split()))
ans = 1
for i in A:
    i //= 2
    ans = LCM(ans,i)
    if (ans//i)%2 == 0:
        print(0)
        exit()
    if ans > M:
        print(0)
        exit()
print(M//ans-M//(ans*2))
X=int(input())
i=2
L=[]
import math
while math.floor(X**(1/i))!=1:
    L.append(math.floor(X**(1/i))**2)
    i+=1
print(max(L))

### FIXED CODE ###

X=int(input())
L=[1]
for i in range(2,X+1):
  j=2
  while i**j<=X:
    L.append(i**j)
    j+=1
print(max(L))
_ = int(input())
s = list(input())

ans = 0
for i in range(len(s)-2):
    ans += "ABC" == f"{s[i]}{s[i+1]}{s[i+2]}"

print(ans)

### FIXED CODE ###

_ = int(input())
s = str(input())

ans = 0
for i in range(len(s)-2):
    ans += "ABC" == '{}'.format(s[i:i+3])

print(ans)
#!/usr/bin/env python3
# Atcoder necoak answer
# https://atcoder.jp/contests/agc040/tasks/agc040_a

MAX_INT = 100000
s_txt = input()


def func(my_suretu, my_s_txt):
    #print('func(', my_suretu, my_s_txt, ')')

    if (len(my_s_txt) == 0):
        #print(my_suretu)
        print(sum(my_suretu))
        exit()
    else:
        next_my_s_txt = my_s_txt[1:]

    for v in range(0, MAX_INT):
        if (len(my_suretu)==0):
            func(my_suretu + [v], next_my_s_txt)
        elif (((my_s_txt[0] == '>') and (my_suretu[-1] > v)) or 
            ((my_s_txt[0] == '<') and (my_suretu[-1] < v))):
            #print(my_suretu[-1], my_s_txt[0], v)
            func(my_suretu + [v], next_my_s_txt)
        

for v in range(0, MAX_INT):
    func([v], s_txt)



### FIXED CODE ###

#!/usr/bin/env python3
# Atcoder necoak answer
# https://atcoder.jp/contests/agc040/tasks/agc040_a

s = input()
a = [0] * (len(s) + 1)

for i in range(0, len(s)):
    if (s[i] == '<'):
        a[i+1] = a[i] + 1
for i in range(len(s)-1, -1, -1):
    if (s[i] == '>'):
        a[i] = max(a[i], a[i+1]+1)
#print(a)
print(sum(a))
n = int(input())
x = input()
original_pop_cnt = x.count("1")

pop_cnt_add = original_pop_cnt + 1
pop_cnt_sub = original_pop_cnt - 1

n_after_once_popcount_add = 0
n_after_once_popcount_sub = 0

for i in range(n):
    n_after_once_popcount_add = (n_after_once_popcount_add * 2 + int(x[i])) % pop_cnt_add
    n_after_once_popcount_sub = (n_after_once_popcount_sub * 2 + int(x[i])) % pop_cnt_sub

pow_add = [1] * (n + 100)
pow_sub = [1] * (n + 100)

for i in range(1, n + 100):
    pow_add[i] = (pow_add[i-1]*2) % pop_cnt_add
    pow_sub[i] = (pow_sub[i-1]*2) % pop_cnt_sub

def f(nex):
    ans = 0
    num = nex
    while num != 0:
        num = num % bin(num).count("1")
        ans += 1
    return ans

for i in range(n-1, -1, -1):
    if x[n - 1 - i] == "0":
        nxt = n_after_once_popcount_add
        nxt = nxt + pow_add[i]
        nxt = nxt % pop_cnt_add
        print(f(nxt) + 1)
    if x[n - 1 - i] == "1":
        if pop_cnt_sub != 0:
            nxt = n_after_once_popcount_sub
            nxt = nxt - pow_sub[i]
            nxt = nxt % pop_cnt_sub
            print(f(nxt) + 1)
        else:
            print(0)



            

### FIXED CODE ###

n = int(input())
x = input()
original_pop_cnt = x.count("1")

pop_cnt_add = original_pop_cnt + 1
pop_cnt_sub = original_pop_cnt - 1

n_after_once_popcount_add = 0
n_after_once_popcount_sub = 0

for i in range(n):
    n_after_once_popcount_add = (n_after_once_popcount_add * 2 + int(x[i])) % pop_cnt_add
    if pop_cnt_sub != 0:
        n_after_once_popcount_sub = (n_after_once_popcount_sub * 2 + int(x[i])) % pop_cnt_sub

pow_add = [1] * 250000
pow_sub = [1] * 250000
for i in range(1, n + 100):
    pow_add[i] = (pow_add[i-1]*2) % pop_cnt_add
    if pop_cnt_sub != 0:
        pow_sub[i] = (pow_sub[i-1]*2) % pop_cnt_sub

def f(nex):
    ans = 0
    num = nex
    while num != 0:
        num = num % bin(num).count("1")
        ans += 1
    return ans

for i in range(n-1, -1, -1):
    if x[n - 1 - i] == "0":
        nxt = n_after_once_popcount_add
        nxt = nxt + pow_add[i]
        nxt = nxt % pop_cnt_add
        print(f(nxt) + 1)
    if x[n - 1 - i] == "1":
        if pop_cnt_sub != 0:
            nxt = n_after_once_popcount_sub
            nxt = nxt - pow_sub[i]
            nxt = nxt % pop_cnt_sub
            print(f(nxt) + 1)
        else:
            print(0)
n = int(input())

if 1 <= n <= 99:
    print(min(n,9))
elif 100<= n <= 9999:
    print(min(n-90,910))
elif:
    print(n-9080)

### FIXED CODE ###

n = int(input())

if 1 <= n <= 99:
    print(min(n,9))
elif 100<= n <= 9999:
    print(min(n-90,909))
else:
    print(min(90909,n-10000+910))
S = input()
L = list(map(ord, S))
if len(S) == 26:
    if S == "zyxwvutsrqponmlkjihgfedcba":
        print(-1)
    else:
        pre = set()
        for i, l in enumerate(L[::-1]):
            if pre:
                if min(pre) > l:
                    print(reversed(reversed(S)[i + 1 :]) + chr(min(pre)))
                    break
            pre.add(l)
else:
    for _ in range(ord("a"), ord("z") + 1):
        if not (i in L):
            break
    print(S + chr(i))

### FIXED CODE ###

S = input()
if len(S) == 26:
    done = set()
    for i, s in enumerate(S[::-1]):
        s = ord(s)
        if done:
            if max(done) < s:
                done.add(s)
                if i == 25:
                    print(-1)
            elif i != 25:
                l = 30
                for d in done:
                    if l > abs(d - s) and s < d:
                        x = d
                        l = d - s
                print(S[: -(i + 1)] + chr(x))
                break
            else:
                print(chr(ord(S[0]) + 1))
        else:
            done.add(s)
else:
    for i in range(ord("a"), ord("z") + 1):
        if not (chr(i) in S):
            print(S + chr(i))
            break
s = raw_input()
k = x = 0
while 1:
        x += 1
        if "J"*x+"O"*x+"I"*x in s:
                k = x
        elif "J"*x in s:
                pass
        elif "O"*x in s:
                pass
        elif "I"*x in s:
                pass
        else:
                print(k)
                break

### FIXED CODE ###

s = raw_input()
k = x = 0
try:
        while 1:
                cj = co = ci = 0
                while s[x] == "J":
                        cj += 1
                        x += 1
                while s[x] == "O":
                        co += 1
                        x += 1
                while s[x] == "I":
                        ci += 1
                        x += 1
                if co <= cj and co <= ci:
                        k = max(co,k)
except IndexError:
        if co <= cj and co <= ci:
                k = max(co,k)
        print(k)
a=input()
if “AC” in a:
  print(“Yes”)
else:print(“No”)

### FIXED CODE ###

a=input()
if "AC" in a:
  print("Yes")
else:print("No")
# coding:utf-8
import readline
import datetime

H1 = int(input())
M1 = int(input())
H2 = int(input())
M2 = int(input())
K = int(input())

while 0 <= H1 < 23 and 0 <= M1 < 60 and 0 <= H2 < 23 and 0 <= M2 < 60:
    if M2 > M1:
        a = (H2 - H1) * 60 + M2 - M1
        print(a - K)
    else:
        M2 < M1
        b = (H2 - H1) * 60 + M1 - M2
        print(b - K)
else:
  	H1 = int(input())
	M1 = int(input())
	H2 = int(input())
	M2 = int(input())
	K = int(input())

### FIXED CODE ###

import sys
readline = sys.stdin.buffer.readline

h1, m1, h2, m2, k = map(int, readline().split())
print(60 * (h2 - h1) + m2 - m1 - k)
H,W=map(int,input().split())
c=[]
for i in range(10):
  c.append(list(map(int,input().split())))

for i in range(10):
  for j in range(10):
    for k in range(10):
      c[i][j]=min(c[i][j],c[i][k]+c[k][j])
#print(c)

ans=0
for i in range(H):
  A=list(map(int,input()))
  for j in A:
    if A[i][j]!=-1:
      ans+=c[A[i][j]][1]
print(ans)

### FIXED CODE ###

H,W=map(int,input().split())
c=[]
for i in range(10):
  c.append(list(map(int,input().split())))

for k in range(10):
  for i in range(10):
    for j in range(10):
      c[i][j]=min(c[i][j],c[i][k]+c[k][j])
#print(c)

ans=0
for i in range(H):
  A=list(map(int,input().split()))
  for j in A:
    if j>=0:
      ans+=c[j][1]
print(ans)
import sys
input = sys.stdin.readline

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

XOR=0
for a in A:
    XOR^=a

for i in range(N):
    A[i] &=~XOR
    
USED=[0]*60

for bi in range(60,-1,-1):
    for i in range(N):
        if USED[i]==0 and A[i] & (1<<bi)!=0:
            USED[i]=1
            useind=i
            break
    else:
        continue

    for i in range(N):
        if i==useind:
            continue
        if A[i] & (1<<bi)!=0:
            A[i]^=A[useind]
            
ANS=0
for a in A:
    ANS^=a

print(2*ANS+XOR)


### FIXED CODE ###

import sys
input = sys.stdin.readline

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

XOR=0
for a in A:
    XOR^=a

for i in range(N):
    A[i] &=~XOR
    
USED=[0]*N

for bi in range(60,-1,-1):
    for i in range(N):
        if USED[i]==0 and A[i] & (1<<bi)!=0:
            USED[i]=1
            useind=i
            break
    else:
        continue

    for i in range(N):
        if i==useind:
            continue
        if A[i] & (1<<bi)!=0:
            A[i]^=A[useind]
            
ANS=0
for a in A:
    ANS^=a

print(2*ANS+XOR)
a={"A":"T","T":"A","C":"G","G":"C"}
print(b[input()])

### FIXED CODE ###

a={"A":"T","T":"A","C":"G","G":"C"}
print(a[input()])
s = input()
n = len(s)

t = []
for i in range(1, n):
    if s[i] != s[i-1]:
        t.append(max(i, n-i))
print(min(t))

### FIXED CODE ###

s = input()
n = len(s)

t = [n]
for i in range(1, n):
    if s[i] != s[i-1]:
        t.append(max(i, n-i))
print(min(t))
D,N = map(int,input().split())
#0 5
A = [int(i) for i in range(1,100)]
B = [int(i*100) for i in range(1,100)]
C = [int(i*10000) for i in range(1,100)]

if D == 0:
	print(A[N-1])
elif D == 1:
	print(B[N-1])
else:
	print(C[N-1])

### FIXED CODE ###

D,N = map(int,input().split())
A = [int(i) for i in range(1,100)] + [101]
B = [int(i*100) for i in range(1,100)] + [10100]
C = [int(i*10000) for i in range(1,100)] + [1010000]

if D == 0:
	print(A[N-1])
elif D == 1:
	print(B[N-1])
else:
	print(C[N-1])
N = int(input())

P = int(input())

out_range = 10**18

for i in range(N-1):
    tmp = int(input())
    if  P > out_range or tmp > out_range:
        print(-1)
        exit()
    if tmp == 0:
        print(0)
        exit()
    P = tmp * P

print(P)


### FIXED CODE ###

N = int(input())

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

out_range = 10**18

ans=1
if  0 in P:
    print(0)
    exit()

for i in range(N):
    tmp = P[i]
    ans *= tmp
    if  ans > out_range:
        print(-1)
        exit()

print(ans)
import sys
from collections import deque
inputs = sys.stdin.readlines()

n = int(inputs[0])
edges = [tuple(map(int, x.split())) for x in inputs[1:]]

tree, colors = [[] for _ in range(n)], dict()
for x, y in edges:
    tree[x-1].append(y-1)
    tree[y-1].append(x-1)
    colors[(x-1, y-1)] = 0
use_color = max(len(x) for x in tree)

queue, passed = deque([0]), set()
while queue:
    x = queue.popleft()
    passed.add(x)
    pallet = [i for i in range(use_color)][::-1]
    for y in tree[x]:
        if y in passed:
            if (x, y) in colors:
                pallet.remove(colors[(x, y)])
            if (y, x) in colors:
                pallet.remove(colors[(y, x)])
            continue
        colors[(x, y)] = pallet.pop()
        queue.append(y)

print(use_color)
for c in colors.values():
    print(c+1)

### FIXED CODE ###

from collections import deque
 
N, *AB = map(int, open(0).read().split())
B = AB[1::2]
 
E = [[] for _ in range(N + 1)]
for a, b in zip(*[iter(AB)] * 2):
    E[a].append(b)

Q = deque([1])
C = [0] * (N + 1)
while Q:
    v = Q.popleft()
    c = 0
    for u in E[v]:
        c += 1 + (c + 1 == C[v])
        C[u] = c
        Q.append(u)

print(max(C))
for b in B:
    print(C[b])
h,a=map(int,input.split())
if h%a==0:
  print(h//a)
else:
  print(h//a+1)

### FIXED CODE ###

h,a=map(int,input().split())
if h%a==0:
  print(h//a)
else:
  print(h//a+1)
N = int(input())
A = list(map(int, input().split()))
B = list(map(int, input().split()))

AB = [(a, i, 0) for i, a in enumerate(A)] + [(b, i, 1) for i, b in enumerate(B)]
AB.sort()

X = AB[:N]
Y = AB[N:]

if any(x[0] == y[0] for x, y in zip(X, Y)):
    print('No')
    exit()

ans = [-1] * N
swap = []

for (_, i, sx), (_, j, sy) in zip(X, Y):
    if sx == sy:
        swap.append((min(i, j), max(i, j)))
    else:
        if sx == 0:
            ans[i] = B[j]
        else:
            ans[j] = B[i]

from collections import Counter
assert max(Counter(swap).values()) == 2, 'error'

print('Yes')
print(*ans)


### FIXED CODE ###

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

AB = [(a, i, 0) for i, a in enumerate(A)] + [(b, i, 1) for i, b in enumerate(B)]
AB.sort()

X = AB[:N]
Y = AB[N:]

if any(x[0] == y[0] for x, y in zip(X, Y)):
    print('No')
    exit()

swapA = []
swapB = []
ans = [-1] * N

for (_, i, sx), (_, j, sy) in zip(X, Y):
    if sx == sy == 0:
        swapA.append((i, j))
    elif sx == sy == 1:
        swapB.append((i, j))
    else:
        if sx == 0:
            ans[i] = B[j]
        else:
            ans[j] = B[i]

for (i, j), (x, y) in zip(swapA, swapB):
    ans[i] = B[x]
    ans[j] = B[y]

    if A[i] == ans[i] or A[j] == ans[j]:
        ans[i], ans[j] = ans[j], ans[i]

print('Yes')
print(*ans)
a = int(input()) // 値の数
b = list(map(int, input().split()))
count = 0
while(1):
  for i in range(0, a, 1):
    if (b[i] % 2 == 1) :
      break;
  for i in range(0, a, 1):
    b[i] /= 2
  count += 1
print(count)

### FIXED CODE ###

a = int(input())
b = list(map(int, input().split()))
count = 0
while(1):
  flag = 0
  for i in range(0, a, 1):
    if (b[i] % 2 == 1) :
      flag = 1
  if (flag == 1) :
    break
  for i in range(0, a, 1):
    b[i] /= 2
  count += 1
print(count)
l* = map(int,input().split())
print(sum(l)-max(l))

### FIXED CODE ###

l = list(map(int,input().split()))
print(sum(l)-max(l))
n=int(input())
count=0
maxlen=[]
xlist=list(map(int,input().split()))
if n==1:
    print(0)
else:
    for i in range(n - 1):
        if xlist[i] >= xlist[i + 1]:
            count += 1
        else:
            maxlen.append(count)
            count = 0

print(max(max(maxlen),count))








### FIXED CODE ###

n=int(input())
count=0
maxlen=[]
xlist=list(map(int,input().split()))
if n==1:
    print(0)
elif n==2:
    if xlist[0]>=xlist[1]:
        print(1)
    else:
        print(0)
else:
    for i in range(n - 1):
        if xlist[i] >= xlist[i + 1]:
            count += 1
            if i==n-2:
                maxlen.append(count)
        else:
            maxlen.append(count)
            count = 0
    print(max(maxlen))
from itertools import combinations_with_replacement

N, M, Q = map(int, input().split())
L = []
for _ in range(Q):
    L.append(tuple(map(int, input().split())))

ans = 0
for A in combinations_with_replacement(range(1, M + 1), min(N, M)):
    tmp = 0
    for a, b, c, d in L:
        if A[b - 1] - A[a - 1] == c:
            tmp += d

    if tmp > ans:
        ans = tmp

print(ans)


### FIXED CODE ###

from itertools import combinations_with_replacement

N, M, Q = map(int, input().split())
L = []
for _ in range(Q):
    L.append(tuple(map(int, input().split())))

ans = 0
_N = N
if N < M:
    _N = M

for A in combinations_with_replacement(range(1, M + 1), _N):
    tmp = 0
    for a, b, c, d in L:
        if a <= _N and b <= _N and A[b - 1] - A[a - 1] == c:
            tmp += d

    if tmp > ans:
        ans = tmp

print(ans)
A,B= map(int,input().split(" "))
count = 0
x = int(A/10**4)
y = int(A/10**3) - x*10
z = int(A/10**2) - x*10**2 - y*10
N = A
while N <= B:
    while y < 10:
        while z < 10:
                    N = x*(10**4)+y*(10**3)+z*(10**2)+y*(10**1)+x
                    if N > B:
                        break
                    if N == b:
                        count = count + 1
                        break
                    count = count + 1
                    z = z + 1
        z = 0
        y = y + 1
        if N >= B:
            break
    x = x + 1
    y = 0
print(count-1)

### FIXED CODE ###

A,B= map(int,input().split(" "))
count = 0
x = int(A/10**4)
y = int(A/10**3) - x*10
z = int(A/10**2) - x*10**2 - y*10
N = A
while N <= B:
    while y < 10:
        while z < 10:
                    N = x*(10**4)+y*(10**3)+z*(10**2)+y*(10**1)+x
                    if N > B:
                        break
                    if N == B:
                        count = count + 1
                        break
                    if N < A:
                        count = count -1
                    count = count + 1
                    z = z + 1
        z = 0
        y = y + 1
        if N >= B:
            break
    x = x + 1
    y = 0
print(count)
import numpy as np
from collections import Counter

H, W, M = [int(n) for n in input().split()]
h = []
w = []
table = np.zeros((H, W))
for m in range(M):
    tmp = [int(n) for n in input().split()]
    h.append(tmp[0])
    w.append(tmp[1])
    table[tmp[0]-1][tmp[1]-1] = 1

h_counter = Counter(h)
w_counter = Counter(w)

most_common_h_list = []
most_common_w_list = []

most_common_h_count = 0
for k, v in h_counter.most_common():
    if v < most_common_h_count:
        break
    most_common_h_list.append(k)
    most_common_h_count = v

most_common_w_count = 0
for k, v in w_counter.most_common():
    if v < most_common_w_count:
        break
    most_common_w_list.append(k)
    most_common_w_count = v

ans = 0
finished = False
for hh in most_common_h_list:
    if finished:
        break
    for ww in most_common_w_list:
        if table[hh-1][ww-1] == 1:
            tt = most_common_h_count + most_common_w_count - 1
            if tt > ans:
                ans = tt
        else:
            tt = most_common_h_count + most_common_w_count
            if tt > ans:
                ans = tt
            finished = True
            break

print(ans)


### FIXED CODE ###

H, W, M = [int(n) for n in input().split()]
H_freq = [0] * H
W_freq = [0] * W

table = []
for m in range(M):
    h, w = [int(n)-1 for n in input().split()]
    H_freq[h] += 1
    W_freq[w] += 1
    table.append((h, w))

max_h = max(H_freq)
max_w = max(W_freq)
most_freqent_h = [i for i, h in enumerate(H_freq) if h == max_h]
most_freqent_w = [i for i, w in enumerate(W_freq) if w == max_w]

count = 0
for (h, w) in table:
    if H_freq[h] == max_h and W_freq[w] == max_w:
        count += 1

if count < len(most_freqent_h) * len(most_freqent_w):
    print(max_h + max_w)
else:
    print(max_h + max_w - 1)
N,X = (int(i) for i in input().split()) 
L = [int(i) for i in input().split()] 
D=0
i=0
while(D<=X):
  D=D+L[i]
  i=i+1
print(i)

### FIXED CODE ###

N, X = map(int, input().split())
L = list(map(int, input().split()))
count = 1
line = 0
for i in range(N):
    line += L[i]
    if line <= X:
        count += 1
print(count)
N = int(input())
S = list(map(int, input()))
Q = int(input())
T = list(map(int, input()))

match_count = 0
for i in T:
    for j in S:
        if i == j:
            match_count += 1
            break

print(str(match_count))



### FIXED CODE ###

n = int(input())
S = set([int(i) for i in input().split()])
q = int(input())
T = set([int(i) for i in input().split()])
print(len( S & T ))
N = int(input())

t = [0]
x = [0]
y = [0]
for i in range(N):
    t1, x1, y1 = [int(j) for j in input().split()]
    t.append(t1)
    x.append(x1)
    y.append(y1)

count = 0
for i in range(N):
    dt = t[i+1] - t[i]
    dist = abs(x[i+1] - x[i]) + abs(y[i+1] - y[i])
    if dist > dt:
        break
    elif dt%2 != dist%2:
        break
    else:
        count += 1

if count == N:
    print('Yes')
else:
    print('No')

### FIXED CODE ###

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

if a*b % 2 != 0:
    print('Odd')
else:
    print('Even')
S = list(input())
T = list(input())
S.sort()
T.sort()
SKind = []
TKind = []
cnt = 1
for i in range(1,len(S)):

    if i == N-1:
        if S[i]==S[i-1]:
            cnt += 1
            SKind.append(cnt)
        else:
            SKind.append(cnt)
            SKind.append(1)
    elif S[i]==S[i-1]:
        cnt+=1
    elif S[i]!=S[i-1]:
        SKind.append(cnt)
        cnt = 1
cnt = 1        
for i in range(1,len(T)):
    if i == N-1:
        if T[i]==T[i-1]:
            cnt += 1
            TKind.append(cnt)
        else:
            TKind.append(cnt)
            TKind.append(1)
    elif T[i]==T[i-1]:
        cnt+=1
    elif T[i]!=T[i-1]:
        TKind.append(cnt)
        cnt = 1
SKind.sort()
TKind.sort()
if SKind == TKind:
    print("Yes")
else: print("No")

### FIXED CODE ###

S = list(input())
T = list(input())
S.sort()
T.sort()
SKind = []
TKind = []
cnt = 1
for i in range(1,len(S)):
    if i == len(S)-1:
        if S[i]==S[i-1]:
            cnt += 1
            SKind.append(cnt)
        else:
            SKind.append(cnt)
            SKind.append(1)
    elif S[i]==S[i-1]:
        cnt+=1
    elif S[i]!=S[i-1]:
        SKind.append(cnt)
        cnt = 1
cnt = 1        
for i in range(1,len(T)):
    if i == len(T)-1:
        if T[i]==T[i-1]:
            cnt += 1
            TKind.append(cnt)
        else:
            TKind.append(cnt)
            TKind.append(1)
    elif T[i]==T[i-1]:
        cnt+=1
    elif T[i]!=T[i-1]:
        TKind.append(cnt)
        cnt = 1
SKind.sort()
TKind.sort()
if SKind == TKind:
    print("Yes")
else: print("No")
d = int(input())
t = int(input())
s = int(input())
if(d <= t*s):
    print("Yes")
else:
    print("No")    


### FIXED CODE ###

d,t,s = map(int, input().split())
if(d <= t*s):
    print("Yes")
else:
    print("No")
A=int(input())
B=int(input())

if  A % 3 == 0 : print("Possible")
else: print("Impossible")
if B % 3 == 0 : print("Possible")
else: print("Impossible")
if A+B % 3 == 0 : print("Possible")
else: print("Impossible")

### FIXED CODE ###

a,b=map(int,input().split())
c=a + b
 
if  a%3==0 or b%3==0 or c%3==0: print("Possible")
else: print("Impossible")
# coding: utf-8
 
N,A,B=list(map(int,input().split()))
 S  = input()

for i in range(N):
    if S[i] == "c":
        print("No")
    elif S[i] == "a":
        if i < A+B:
            print("Yes")
        else:
            print("No")
    elif S[i] == "b":
        if i < B:
            print("Yes")
        else:
            print("No") 


### FIXED CODE ###

N, A, B = map(int, input().split())
S = input()
count = 0
count2 = 0


for i in range(N):
    if S[i] == "c":
        print("No")
    elif S[i] == "a":
        
        if count < A+B:
            print("Yes")
            count += 1
        else:
            print("No")
    elif S[i] == "b":
        
        if count < A+B and count2 < B:
            print("Yes")
            count += 1
            count2 += 1
        else:
            print("No")
a,b=map(int,input().split())
c=list(map(int,input().split()))
d=0
e=0
f=1
while 1:
  d+=c[e]
  e+=1
  f+=1
  if d>=b:
    print(f)
    break
  else:
    pass

### FIXED CODE ###

n, x = map(int, input().split())
l = map(int, input().split())

d = 0
ans = 1
for li in l:
    d += li
    if d > x:
        break
    ans += 1
print(ans)