Harryxun/sft_time huggingface dataset:
### BUGGY CODE ###

def resolve():
    M, N, K = map(int, input().split())
    a = list(map(int, input().split()))
    b = list(map(int, input().split()))

    count = 0
    for m in range(M+1):
        sumA = sum(a[:m])
        if sumA > K:
            break
        for n in range(N+1):
            sumB = sum(b[:n])
            if sumB > K:
                break
            if (sumA + sumB) <= K:
                count = max(count, m + n)
            else:
                break
    print(count)

if __name__ == "__main__":
    resolve()

### FIXED CODE ###

def resolve():
    N, M, K = map(int, input().split())
    A = list(map(int, input().split()))
    B = list(map(int, input().split()))

    a, b = [0], [0]
    for i in range(N):
        a.append(a[i] + A[i])
    for i in range(M):
        b.append(b[i] + B[i])

    count = 0
    j = M
    for i in range(N + 1):
        if a[i] > K:
            break
        while b[j] > K - a[i]:
            j -= 1
        count = max(count, i + j)
    print(count)

if __name__ == "__main__":
    resolve()
### BUGGY CODE ###

import math
from functools import reduce
import itertools
from scipy.special import comb

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

k = int(input())
cnt = 0
b = list(range(1, k+1))
b = list(map(str, b))

c = itertools.combinations_with_replacement(b, 3)

c = list(c)

f = []
for i in range(len(c)):
    d = list(map(int, c[i]))
    dd = list(set(d))
    e = gcd(*d)
    if len(dd) == 1:
        cnt += e
    elif len(dd) == 2:
        cnt += e*3
    else:
        cnt += e*6

print(cnt)

### FIXED CODE ###

from math import gcd
K = int(input())
sum = 0
for a in range(K):
    for b in range(K):
        g = gcd(a + 1, b + 1)
        for c in range(K):
            sum += gcd(g, c + 1)
print(sum)
### BUGGY CODE ###

x = int(input())

a = 0
while(True):
    a5 = a ** 5
    b = x - a5
    b = int(x ** (1 / 5))
    b5 = b**5
    if a5 - b5 == x:
        break
#     if a5 - (b5*-1) == x:
#         b *= -1
#         break
    b = x + a5
    b = int(x ** (1 / 5))
    b5 = b**5
    if a5 - b5 == x:
        a *= -1
        break
#     if a5 - (b5*-1) == x:
#         a *= -1
#         b *= -1
#         break
    a += 1
print(a, b)    

### FIXED CODE ###

x = int(input())

flg = 'n'
for a in range(-120, 121, 1):
    for b in range(-120, 121, 1):
        if a ** 5 - b ** 5 == x:
            flg = 'y'
            break
    if flg == 'y':
        break
print(a, b)
### BUGGY CODE ###

s = list(input())
n = len(s)
ans = 0
while True:
    b = False
    for i in range(0, n-2):
        if s[i:i+3] == ['A', 'B', 'C']:
            s[i] = 'B'
            s[i+1] = 'C'
            s[i+2] = 'A'
            ans += 1
            b = True
    if not b:
        break
print(ans)


### FIXED CODE ###

s = list(input())
li = []
n = len(s)
ans = 0
b = False
for i in range(n-1):
    if b:
        b = False
        continue
    if s[i] + s[i+1] == 'BC':
        li.append('D')
        b = True
    if s[i] == 'B' and s[i+1] != 'C':
        li.append('E')
    if s[i] == 'C':
        li.append('E')
    if s[i] == 'A':
        li.append('A')
cnt = 0
for i in range(len(li)):
    if li[i] == 'A':
        cnt += 1
    elif li[i] == 'E':
        cnt = 0
    else:
        ans += cnt
print(ans)
### BUGGY CODE ###

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

unique_S_lis = list(set(S_lis))
res = [S_lis.count(us) for us in unique_S_lis]
maxind = [i for i, x in enumerate(res) if x == max(res)]
lis_ans = sorted([unique_S_lis[i] for i in maxind])

for ans in lis_ans:
    print(ans)

### FIXED CODE ###

N = int(input())
S_lis = []
for _ in range(N):
    S_lis.append(input())


S_set = set(S_lis)
S_dict = dict()
# dict initialize
for s in S_set:
    S_dict[s] = 0
# valが全文字通過していくときに辞書のカウントを+1
for val in S_lis:
    S_dict[val] += 1
max_num = max(S_dict.values())
ans = list()
for k, v in S_dict.items():
    if v == max_num:
        ans.append(k)
ans = sorted(ans)
for res in ans:
    print(res)
### BUGGY CODE ###

S = input()
K = int(input())

A = []
for i in range(len(S)):
    for j in range(1,len(S)+1):
        if S[i:j] != "" and len(S[i:j]) < 6:
            A.append(S[i:j])

A = sorted(set(A))
#A = sorted(set(A), key=A.index)

print(A[K-1])

### FIXED CODE ###

S = input()
K = int(input())

A = []
for i in range(len(S)):  
    for j in range(1,i + 6):
        if S[i:j] != "":
            A.append(S[i:j])

A = sorted(set(A))
        
print(A[K-1])
### BUGGY CODE ###

from itertools import combinations as comb
from copy import deepcopy


def main():
    n = int(input())
    As = list(map(int, input().split()))

    for a in As:
        Bs = deepcopy(As)
        Bs.remove(a)
        b_set = set(Bs)
        ans = 0
        for b in b_set:
            ans += len(list(comb(range(Bs.count(b)), 2)))
        print(ans)


if __name__ == "__main__":
    main()


### FIXED CODE ###

from collections import Counter


def main():
    n = int(input())
    arr = list(map(int, input().split()))

    cnt = Counter(arr)
    total = 0
    for key in cnt.keys():
        total += cnt[key]*(cnt[key]-1)//2

    for i in range(n):
        tmp = total
        tmp -= cnt[arr[i]]*(cnt[arr[i]]-1)//2
        tmp += (cnt[arr[i]]-1)*(cnt[arr[i]]-2)//2
        print(tmp)


if __name__ == "__main__":
    main()
### BUGGY CODE ###

n = int(input())
p = list(map(int, input().split()))

ans = 0

for i in range(n):
    a = p[:i + 1]
    
    if min(a) >= p[i]:
        ans += 1
print(ans)



### FIXED CODE ###

n = int(input())
p = list(map(int, input().split()))

ans = 0

c = p[0]

for i in range(n):
    #a = p[:i + 1]

    if c >= p[i]:
        c = p[i]
    if c >= p[i]:
        ans += 1
print(ans)
### BUGGY CODE ###

# vim: set fileencoding=utf-8:
import bisect


def main():
    N, K = map(int, raw_input().split())
    x = [int(ele) for ele in raw_input().split()]
    o = bisect.bisect_right(x, 0)
    top = min(o + K, N)
    bottom = max(o - K, 0)
    x = x[bottom:top]

    best = 999999999999
    u = len(x)
    for i in xrange(u):
        if u < i + K:
            break

        hani = x[i:i + K]
        if hani[0] < 0 and hani[-1] < 0:
            best = min(best, abs(hani[0]))
        elif hani[0] < 0 <= hani[-1]:
            best = min(best, 2 * abs(hani[0]) + hani[-1])
        elif 0 <= hani[0] and 0 <= hani[-1]:
            best = min(best, hani[-1])

    print(best)


if __name__ == "__main__":
    main()


### FIXED CODE ###

# vim: set fileencoding=utf-8:
import bisect


def main():
    N, K = map(int, raw_input().split())
    x = [int(ele) for ele in raw_input().split()]
    o = bisect.bisect_right(x, 0)
    top = min(o + K, N)
    bottom = max(o - K, 0)
    best = 999999999999
    for i in xrange(K):
        if top < bottom + i + K:
            break

        if x[bottom + i + K - 1] < 0:
            best = min(best, abs(x[bottom + i]))
        elif x[bottom + i] < 0 <= x[bottom + i + K - 1]:
            ans1 = 2 * min(abs(x[bottom + i]), x[bottom + i + K - 1])
            ans2 = max(abs(x[bottom + i]), x[bottom + i + K - 1])
            ans = min(best, ans1 + ans2)
            best = min(best, ans)
        elif 0 <= x[bottom + i]:
            best = min(best, x[bottom + i + K - 1])

    print(best)


if __name__ == "__main__":
    main()
### BUGGY CODE ###

from bisect import bisect_left
M = 200001
n = int(input())
l = [None] * n
ans = 10 ** 18
for i in range(n):
    x, y, u = input().split()
    u = ('R', 'D', 'L', 'U').index(u)
    l[i] = (int(x), int(y), u)
for _ in range(4):
    xy = [[] for _ in range(M * 2 - 1)]
    yx = [[] for _ in range(M * 2 - 1)]
    xs = [[] for _ in range(M)]
    k = []
    for i, t in enumerate(l):
        x, y, u = t
        u %= 4
        if u == 3:
            xy[x + y].append(x)
        elif u == 1:
            yx[x - y + M - 1].append(x)
        elif u == 2:
            xs[y].append(x)
        else:
            k.append((x, y))
        l[i] = (y, -x + M - 1, u + 1)
    for x, y in k:
        xs[y].sort()
        idx = bisect_left(xs[y], x)
        if idx < len(xs[y]):
            ans = min(ans, (xs[y][idx] - x) * 5)
        xy[x + y].sort()
        idx = bisect_left(xy[x + y], x)
        if idx < len(xy[x + y]):
            ans = min(ans, (xy[x + y][idx] - x) * 10)
        yx[x - y + M].sort()
        idx = bisect_left(yx[x - y + M - 1], x)
        if idx < len(yx[x - y + M - 1]):
            ans = min(ans, (yx[x - y + M - 1][idx] - x) * 10)
if ans == 10 ** 18:
    print('SAFE')
else:
    print(ans)


### FIXED CODE ###

from bisect import bisect_left
import sys
input = sys.stdin.readline
M = 200001
n = int(input())
l = [None] * n
ans = 10 ** 18
for i in range(n):
    x, y, u = input().split()
    u = ('R', 'D', 'L', 'U').index(u)
    l[i] = (int(x), int(y), u)
for _ in range(3):
    l.sort(key=lambda x: x[0])
    xy = [[] for _ in range(M * 2 - 1)]
    yx = [[] for _ in range(M * 2 - 1)]
    xs = [[] for _ in range(M)]
    k = []
    for i, t in enumerate(l):
        x, y, u = t
        u %= 4
        if u == 3:
            xy[x + y].append(x)
        elif u == 1:
            yx[x - y + M - 1].append(x)
        elif u == 2:
            xs[y].append(x)
        elif u == 0:
            k.append((x, y))
        l[i] = (y, -x + M - 1, u + 1)
    for x, y in k:
        idx = bisect_left(xs[y], x)
        if idx < len(xs[y]):
            ans = min(ans, (xs[y][idx] - x) * 5)
        idx = bisect_left(xy[x + y], x)
        if idx < len(xy[x + y]):
            ans = min(ans, (xy[x + y][idx] - x) * 10)
        idx = bisect_left(yx[x - y + M - 1], x)
        if idx < len(yx[x - y + M - 1]):
            ans = min(ans, (yx[x - y + M - 1][idx] - x) * 10)
if ans == 10 ** 18:
    print('SAFE')
else:
    print(ans)
### BUGGY CODE ###

import sys
from collections import deque
input = sys.stdin.readline
N = int(input())
D = [[0] * N for n in range(N)]
maxi = -1
AB = [0] * (N-1)
for n in range(N-1):
    a, b = tuple([int(x) for x in input().strip().split()])
    AB[n] = (a, b)
    D[a-1][b-1] = '#'
    D[b-1][a-1] = '#'

maxc = 0

for i, d in enumerate(D):
    c = d.count('#')
    if c > maxc:
        maxc = c
        maxi = i

q = deque([])
c = 1
for i in range(N):
    if D[maxi][i] == '#':
        D[maxi][i] = c
        D[i][maxi] = c
        c += 1
        q.append(i)

while q:
    ind = q.popleft()
    c = 1
    for i in range(N):
        while c in D[ind]:
            c += 1
        if D[ind][i] == '#':
            D[ind][i] = c
            D[i][ind] = c
            c += 1
            if i not in q:
                q.append(i)

print(maxc)
for a, b in AB:
    print(D[a-1][b-1])

### FIXED CODE ###

import sys
from collections import deque
input = sys.stdin.readline
sys.setrecursionlimit(100000)
N = int(input())
D = [deque([]) for _ in range(N)]
cnt = 0
AB = [0] * (N-1)
dic = {}
for n in range(N-1):
    a, b = [int(x) for x in input().strip().split()]
    AB[n] = (a-1, b-1)
    dic[(a, b)] = 0
    D[a-1].append(b-1)
    D[b-1].append(a-1)

print(max([len(d) for d in D]))

def dp(pp, p, c):
    global dic
    nc = 1
    for np in D[p]:
        if np == pp:
            continue
        if nc == c:
            nc += 1
        dic[(p, np)] = nc
        dp(p, np, nc)
        nc += 1
    return 0

dp(-1, 0, 0)
for ab in AB:
    print(dic[ab])
### BUGGY CODE ###

N = int(input())
A = list(map(int, input().split()))
ans = 1
if N % 2 == 0:
    
    for i in list(range(1, N, 2)):
        if 1 <= A.count(i) <= 2:
            ans = (ans*A.count(i))%(10**9+7)
        else:
            ans = 0
            break
else:
    if A.count(0) == 1:
        
        for i in list(range(0, N, 2)):
            if 1 <= A.count(i) <=2:
                ans = (ans*A.count(i))%(10**9+7)
            else:
                ans = 0
                break
    else:
        ans = 0

print(ans)

### FIXED CODE ###

N = int(input())
A = list(map(int, input().split()))
ans = 1
if N % 2 == 0:
    if len(A) != 2*len(set(A)):
        ans = 0
else:
    if A.count(0) == 1:
        A.remove(0)
        if len(A) != 2*len(set(A)):
            ans = 0
    else:
        ans = 0
if ans == 0:
    print(0)
else:
    print((2**(N//2))%(10**9+7))
### BUGGY CODE ###

import sys
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))

N = INT()
print(sum(range(N)))



### FIXED CODE ###

n = int(input())
print((n*(n-1))//2)
### BUGGY CODE ###

n = int(input())
a_arr = []
for i in range(n):
    a_arr.append(list(map(int,input().split())))
cnt = [0]*n
day = 0
for k in range(n*(n-1)//2 + 1):
    day += 1
    jdg = [0]*n
    for i in range(n):
        if jdg[i] != 0 or cnt[i] == n -1 :
            continue
        tmp = a_arr[i][cnt[i]] - 1 
        if cnt[tmp] < n - 1 and a_arr[tmp][cnt[tmp]] == i + 1 and jdg[tmp] == 0:
            cnt[i] += 1
            cnt[tmp] += 1
            jdg[i] += 1
            jdg[tmp] += 1
    if day > (n-1)*n//2:
        print(-1)
        exit()
    if cnt == [n-1]*n:
        break
print(day)

### FIXED CODE ###

n = int(input())
a = [[] for i in range(n)]
for i in range(n):
    a[i] = list(map(int,input().split()))
    for j in range(n-1):
        a[i][j] -= 1
    a[i].reverse()
q = []

def check(i):
    if len(a[i]) == 0:
        return 
    j = a[i][-1]
    if len(a[j]) == 0:
        return
    if a[j][-1] == i:
        q.append([min(i,j), max(i,j)])
for i in range(n):
    check(i)
day = 0
while (len(q) > 0):
    day += 1
    prevQ = list(map(list, set(map(tuple, q))))
    q = []
    for i,j in prevQ:
        a[i].pop()
        a[j].pop()
        check(i)
        check(j)
for i in range(n):
    if len(a[i]) > 0:
        print(-1)
        exit()
print(day)
### BUGGY CODE ###

s = list(input())
t = list(input())
ls = len(s)
lt = len(t)
dp = [[[] for i in range(lt+1)] for i in range(ls+1)]
for i in range(ls):
    flag = True
    for j in range(lt):
        if flag and s[i] == t[j]:
            dp[i+1][j+1] = max(dp[i][j+1]+[s[i]],dp[i+1][j]+[s[i]],key=lambda x: len(x))
            flag= False
        elif s[i] == t[j]:
            dp[i+1][j+1] = max(dp[i][j+1]+[s[i]],dp[i+1][j],key=lambda x: len(x))
        else:
            dp[i+1][j+1] = max(dp[i][j+1],dp[i+1][j],key=lambda x: len(x))
print(''.join(dp[ls][lt]))

### FIXED CODE ###

s = list(input())
t = list(input())
ls = len(s)
lt = len(t)
ans = []
dp = [[0] * (lt+1) for i in range(ls+1)]
for i in range(ls):
    flag = True
    for j in range(lt):
        if s[i] == t[j]:
            dp[i+1][j+1] = dp[i][j] + 1
        else:
            dp[i+1][j+1] = max(dp[i][j+1],dp[i+1][j])
i = ls
j = lt
while i > 0 and j > 0:
    if dp[i][j] == dp[i-1][j]:
        i -= 1
    elif dp[i][j] == dp[i][j-1]:
        j -= 1
    else:
        i -= 1
        j -= 1
        ans.append(s[i])
print(''.join(reversed(ans)))
### BUGGY CODE ###

import difflib
n = int(input())
l = list(map(int, input().split()))
total = 0
last = 0
for i in range(n):
  total = 0
  last = 0
  for j in range(n):
    if j == i:
      pass
    else:
      total += abs(l[j] - last)
      last = l[j]
  total += abs(last)
  print(total)

### FIXED CODE ###

n = int(input())
l = [0]
l += list(map(int, input().split()))
l += [0]
base = 0

for i in range(n+2):
  base += abs(l[i-1] - l[i])

for i in range(1, n+1):
  ans = base + abs(l[i+1]-l[i-1]) - abs(l[i+1]-l[i]) - abs(l[i-1]-l[i])
  print(ans)
### BUGGY CODE ###

s = input()
t = input()
if set(t) & set(s) == set(t):
    n = -1
    c = 0
    for i in t:
        try:
            n = list(s)[n + 1:].index(i) + n + 1
        except:
            n = -1
        if n == -1:
            c += 1
            try:
                n = list(s).index(i)
            except:
                n = -1
    print(n + len(s) * c + 1)
else:
    print(-1)

### FIXED CODE ###

s = input()
t = input()
if set(t) & set(s) == set(t):
    n = -1
    c = 0
    for i in t:
        n = s.find(i, n + 1)
        if n == -1:
            c += 1
            n = s.find(i)
    print(n + len(s) * c + 1)
else:
    print(-1)
### BUGGY CODE ###

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

from math import ceil

def can_korosu(t):
    count = 0
    for h in H:
        count += ceil(max(0, h - t*B)/(A-B))
        if count > t:
            return False
    return True

lo = 0
hi = 10**9

for _ in range(50):
    mid = (hi + lo) // 2
    if can_korosu(mid):
        hi = mid
    else:
        lo = mid
print(hi)

### FIXED CODE ###

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

from math import ceil

def can_korosu(t):
    count = 0
    for h in H:
        count += ceil(max(0, h - t*B)/(A-B))
        if count > t:
            return False
    return True

lo = 0
hi = 10**9

p = (lo, hi)
for _ in range(50):
    mid = (hi + lo) // 2
    if can_korosu(mid):
        hi = mid
    else:
        lo = mid
    if p == (lo, hi):
        break
    p = (lo, hi)
print(hi)
### BUGGY CODE ###

def resolve():
    N=int(input())
    X=list(map(int,input().split()))
    Y=sorted(X)

    for i in range(N):
        if Y.index(X[i])>(N//2)-1:
            print(Y[N // 2-1])
        else:
            print(Y[N//2])






resolve()

### FIXED CODE ###

def resolve():
    N=int(input())
    X=list(map(int,input().split()))
    Y=sorted(X)
    l=Y[N // 2-1]
    r=Y[N//2]


    for i in X:
        if i<r:
            print(r)
        else:
            print(l)






resolve()
### BUGGY CODE ###

from bisect import bisect_left
N = int(input())
a=list(map(int, input().split()))
Q = int(input())
b=[]
c=[]
def index(lst, e):
    # Step 1. bisect_left して
    i = bisect_left(lst, e)
    
    # Step 2. 変な値を ValueError で弾いて
    if i == len(lst):
        raise ValueError
    if lst[i] != e:
        raise ValueError
    
    # Step 3. 値を返す。
    return i
for i in range(Q):
  b1,c1=map(int, input().split())
  b.append(b1)
  c.append(c1)

a.sort()
for i in range(Q):
  first=0
  last = 0
  a.sort()
  if b[i] not in a:
    print(sum(a))
  else:
    last = a.count(b[i])
    first = index(a,b[i])
    del a[first:first+last]
    list_c = [c[i]]*last
    a = a+list_c
    print(sum(a))

### FIXED CODE ###

N = int(input())
a=list(map(int, input().split()))
Q = int(input())
num_a =[0]*100001
num_b = []
sum_a = sum(a)
b=[]
c=[]
for i in a:
  num_a[i]+= 1
for i in range(Q):
  b1,c1=map(int, input().split())
  b.append(b1)
  c.append(c1)
for i in range(Q):
  if num_a[b[i]]==0:
    num_b.append(0)
    sum_a = sum_a - b[i]*num_b[i] +c[i]*num_b[i]
  else:
    num_b.append(num_a[b[i]])
    num_a[c[i]] += num_a[b[i]]
    num_a[b[i]] = 0
    sum_a = sum_a - b[i]*num_b[i] +c[i]*num_b[i]
  print(sum_a)
### BUGGY CODE ###

s=list(input())
ans=0
while s:
    a=s[0]
    b=s[-1]
    if a==b:
        s=s[1:-1]
    elif a=="x":
        s=s[1:]
        ans+=1
    elif b=="x":
        s=s[:-1]
        ans+=1
    else:
        print(-1)
        exit()

print(ans)


### FIXED CODE ###

import sys
input=sys.stdin.readline
s=input()[:-1]
ans=0
while s:
    a=s[0]
    b=s[-1]
    if a==b:
        s=s[1:-1]
        continue
    elif a=="x":
        s=s[1:]
        ans+=1
        continue
    elif b=="x":
        s=s[:-1]
        ans+=1
        continue
    else:
        print(-1)
        exit()

print(ans)
### BUGGY CODE ###

#ALDS1_3-C Elementary data structures - Doubly Linked List
n=int(input())
L=[]
for i in range(n):
    cmd=input().split()
    if(cmd[0]=="insert"):
        L=[cmd[1]]+L
    if(cmd[0]=="delete" and cmd[1] in L):
        L.remove(cmd[1])
    if(cmd[0]=="deleteFirst"):
        L.pop(0)
    if(cmd[0]=="deleteLast"):
        L.pop()
s=""
for i in L:
    s+=i+" "
print(s[:-1])

### FIXED CODE ###

#ALDS1_3-C Elementary data structures - Doubly Linked List
import collections
import sys
q = collections.deque()
n=int(input())
_input = sys.stdin.readlines()
cmds={"insert":lambda cmd: q.appendleft(cmd[1]),
      "delete":lambda cmd: q.remove(cmd[1]) if (q.count(cmd[1]) > 0) else "none",
      "deleteFirst":lambda cmd: q.popleft(),
      "deleteLast": lambda cmd: q.pop()
     }

for i in range(n):
    cmd=_input[i].split()
    cmds[cmd[0]](cmd)
print(*q)
### BUGGY CODE ###

x = int(input())
for i in range(-10000, 10000):
    for j in range(-10000, 10000):
        if i**5 - j**5 == x:
            print(str(i) + " " + str(j))
            exit()

### FIXED CODE ###

x = int(input())
for i in range(-1000, 1000):
    for j in range(-1000, 1000):
        if i**5 - j**5 == x:
            print(str(i) + " " + str(j))
            exit()
### BUGGY CODE ###

S = input()

def ctoi(c):
    return ord(c) - ord('a')

masks = [1<<k for k in range(26)]
cums = [0]
for c in S:
    cums.append(cums[-1] ^ masks[ctoi(c)])
if cums[-1] == 0:
    print(1)
    exit()
maskset = set(masks)

dp = {0:0}
for b in cums:
    for m in maskset:
        msk = b^m
        if msk in dp:
            if b in dp:
                dp[b] = min(dp[b], dp[msk]+1)
            else:
                dp[b] = dp[msk]+1
print(dp[cums[-1]])

### FIXED CODE ###

def ctoi(c):
    return ord(c) - ord('a')

def solve(s):
    masks = [1<<k for k in range(26)]
    cums = [0]
    for c in s:
        cums.append(cums[-1] ^ masks[ctoi(c)])
    if cums[-1] == 0:
        print(1)
        exit()

    dp = {0:0}
    for b in cums:
        for m in masks:
            msk = b^m
            if msk in dp:
                if b in dp:
                    dp[b] = min(dp[b], dp[msk]+1)
                else:
                    dp[b] = dp[msk]+1
    return dp[cums[-1]]

print(solve(input()))
### BUGGY CODE ###

import queue
N, M = map(int, input().split())


path = [[] for i in range(N + 1)]


for i in range(M):
    a,b = map(int,input().split())
    path[a].append(b)
    path[b].append(a)


flag_directions = [-1 for i in range(N + 1)]

q = queue.Queue()
for p in path[1]:
    q.put((1, p))

while not q.empty():
    current, to = q.get()
    if flag_directions[to] == -1:
        flag_directions[to] = current 
        for next_room in path[to]:
            q.put((to, next_room))


print('Yes')
for f in flag_directions[2:]:
    print(f)

### FIXED CODE ###

import queue
N, M = map(int, input().split())


path = [[] for i in range(N + 1)]


for i in range(M):
    a,b = map(int,input().split())
    path[a].append(b)
    path[b].append(a)


flag_directions = [-1 for i in range(N + 1)]

q = queue.Queue()
for p in path[1]:
    q.put((1, p))

while not q.empty():
    current, to = q.get()
    if flag_directions[to] == -1:
        flag_directions[to] = current 
        for next_room in path[to]:
            q.put((to, next_room))


print('Yes')
for f in flag_directions[2:]:
    print(f)
### BUGGY CODE ###

d = input()
s = input()

r = s.count('R')
g = s.count('G')
b = s.count('B')

res = r*g*b
for i in range(len(s)-2):
    for j in range(i,len(s)-1):
        for k in range(j, len(s)):
            if (j - i) == (k - j):
                if s[i] != s[k] and s[i] != s[j] and s[j] != s[k]:
                    res -= 1
print(res)

### FIXED CODE ###

d = input()
s = input()

r = s.count('R')
g = s.count('G')
b = s.count('B')

res = r*g*b
for i in range(len(s)-2):
    for j in range(i,len(s)-1):
        k = 2 * j - i
        if k < len(s) and s[i] != s[k] and s[i] != s[j] and s[j] != s[k]:
            res -= 1
print(res)
### BUGGY CODE ###

from operator import mul
from functools import reduce

[n,k] = map(int, input().split(' '))
A = list(map(int, input().split(' ')))

def hyoka(j,p,b_point):
  if j < k:
    return 0
  point = reduce(mul, A[j-k:j])
  if j == k:
    return point
  if b_point < point:
    print('Yes')
  else:
    print('No')
  return point
b_point = 0
for i,p in enumerate(A):
  result = hyoka(i+1,p,b_point)
  if result > 0:
  	b_point = result


### FIXED CODE ###

[n,k] = map(int, input().split(' '))
A = list(map(int, input().split(' ')))

for i in range(k,n):
  if A[i-k]<A[i]:
    print('Yes')
  else:
    print('No')