Harryxun/stf_run huggingface dataset:
for _ in range(int(input())):
    i = int(input())
    if i in A:
        A.remove(i)
    else:
        A.append(i)
        
print(len(A))

### FIXED CODE ###

n=int(input())
d={}
for _ in [0]*n:
    v=int(input())
    d[v]=(d.get(v,0)+1)%2
    
print(sum(d.values()))
from sys import stdin,stdout
size = int(stdin.readline())
li = list(map(int,stdin.readline().split()))
"""ans = [0]*size
for i in li:
    if i not in ans:
        ans[i-1] = 1
    else:
        ans[i-1] += 1
for i in ans:
    print(i)
"""
from collections import Counter
c1 = Counter(li)
ans2 = [0] * size
for i,j in c1.items():
    ans2[i-1] = j
for i in ans2:
    stdout.write(i)


### FIXED CODE ###

size = int(input())
li = list(map(int,input().split()))
from collections import Counter
c1 = Counter(li)
ans2 = [0] * size
for i,j in c1.items():
    ans2[i-1] = j
for i in ans2:
    print(i)
# encoding:utf-8
import math

def main():
	t = int(input())
	qs = [list(map(int, input().split())) for _ in range(t)]
	for q in qs:
		sub(q)

def sub(q):
	a, b, c, d = q
	if d - b < 0:
		print("No")
		return
	
	if a - b < 0:
		print("No")
		return

	if b > c:
		gcd_bd = math.gcd(d, b)
		i = - 10
		while True:
			#print(i)
			#print(gcd_bd, gcd_bd * i + (a - c))
			if 0 < gcd_bd * i + (a - c) % gcd_bd < b - c:
				print("No")
				return
			elif gcd_bd * i + (a - c) % gcd_bd >= b - c:
				print("Yes")
				return
			i += 1
				

	print("Yes")
	return
	
if __name__ == '__main__':
	main()


### FIXED CODE ###

import fractions

def main():
	t = int(input())
	qs = [list(map(int, input().split())) for _ in range(t)]
	for q in qs:
		sub(q)

def sub(q):
	a, b, c, d = q
	if d - b < 0:
		print("No")
		return
	
	if a - b < 0:
		print("No")
		return

	if b > c:
		gcd_bd = fractions.gcd(d, b)
		i = - 10
		while True:
			if 0 < gcd_bd * i + (a - c) % gcd_bd < b - c:
				print("No")
				return
			elif gcd_bd * i + (a - c) % gcd_bd >= b - c:
				print("Yes")
				return
			i += 1
				
	print("Yes")
	return
	
if __name__ == '__main__':
	main()
h,w,k=map(int,input().split())
s=[list(map(int,input().replace("#",'1').replace(".",'0'))) for i in range(h)]
a=s
tmp=1

for i in range(h):
  if sum(s[i])>0:
    for j in range(w):
      if s[i][j] == 1 and sum(s[i][j+1:])>0:
        a[i][j]=tmp
        tmp+=1
      elif j==w-1:
        a[i][j]=tmp
        tmp+=1
      else:
        a[i][j]=tmp

flg=0
for i in range(h):
  if flg>0 and sum(s[i])==0:
    s[i]=s[i-1]
  else:
    flg=i
for i in reversed(range(h)):
  if sum(s[i])==0:
    s[i]=s[i+1]
for i in range(h):
  print(' '.join(list(map(str,a[i]))))

### FIXED CODE ###

h,w,k=map(int,input().split())
s=[list(map(int,input().replace("#",'1').replace(".",'0'))) for i in range(h)]
a=s
tmp=1
for i in range(h):
  if sum(s[i])>0:
    for j in range(w):
      if s[i][j] == 1 and sum(s[i][j+1:])>0:
        a[i][j]=tmp
        tmp+=1
      elif j==w-1:
        a[i][j]=tmp
        tmp+=1
      else:
        a[i][j]=tmp

flg=0
for i in range(h):
  if flg>0 and sum(s[i])==0:
    s[i]=s[i-1]
  else:
    flg=1
for i in reversed(range(h)):
  if sum(s[i])==0:
    s[i]=s[i+1]
for i in range(h):
  print(' '.join(list(map(str,a[i]))))
import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, tan, asin, acos, atan, radians, degrees, log2, gcd
from itertools import accumulate, permutations, combinations, combinations_with_replacement, product, groupby
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from bisect import bisect, bisect_left, insort, insort_left
from heapq import heappush, heappop
from functools import reduce
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()))
def ZIP(n): return zip(*(MAP() for _ in range(n)))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7 
#mod = 998244353
from decimal import *
#import numpy as np
#decimal.getcontext().prec = 10

#階乗#
lim = 2*10**5   #必要そうな階乗の限界を入力
fact = [1] * (lim+1)
for n in range(1, lim+1):
	fact[n] = n * fact[n-1] % mod

#階乗の逆元#
fact_inv = [1]*(lim+1)
fact_inv[lim] = pow(fact[lim], mod-2, mod)
for n in range(lim, 0, -1):
	fact_inv[n-1] = n*fact_inv[n]%mod

def C(n, r):
	if n < r or n < 0 or r < 0:
		return 0
	else:
		return (fact[n]*fact_inv[r]%mod)*fact_inv[n-r]%mod

N, K = MAP()

if N == K:
	for i in range(1, N+1):
		print(i if i == 1 else 0)
	exit()

for i in range(1, K+1):
	blue = C(K-1, i-1) #青いボールをi個の塊に分ける
	red = (C(N-K-1, i-2) + 2*C(N-K-1, i-1) + C(N-K-1, i))%mod #赤いボールをi-1、i、i+1個の塊に分ける(i個の場合は2パターン)
	print((blue*red)%mod)


### FIXED CODE ###

import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, tan, asin, acos, atan, radians, degrees, log2, log
from itertools import accumulate, permutations, combinations, combinations_with_replacement, product, groupby
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from bisect import bisect, bisect_left, insort, insort_left
from fractions import gcd
from heapq import heappush, heappop
from functools import reduce
from decimal import Decimal
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()))
def ZIP(n): return zip(*(MAP() for _ in range(n)))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10**9 + 7
from decimal import *

#i がi番以降にあるなら可能
N = INT()
a = LIST()

ans = deque()
while a:
	for i in range(len(a)-1, -1, -1):
		if a[i] == i+1:
			ans.appendleft(a.pop(i))
			break
	else:
		print(-1)
		exit()

print(*ans, sep="\n")
age=int(input())
if age==3,5,7:
  print"YES"
else :
  print('NO')

### FIXED CODE ###

age=int(input())
if age==3:
  print ('YES')
elif age==5:
  print ('YES')
elif age==7:
  print ('YES')
else :
  print('NO')
k,s = map(int, input().split())
ans = 0
x = range(k + 1)
y = range(k + 1)
z = range(k + 1)


for i in x:
	for j in y:
		for k in z:
			if s - i - j <= z and i + j + k == s:
				ans += 1

print(ans)

### FIXED CODE ###

k,s = map(int, input().split())
ans = 0
x = range(k + 1)
y = range(k + 1)
z = range(k + 1)


for i in x:
	for j in y:
			if 0 <= s - i - j <= k:
				ans += 1

print(ans)
def calc(a):
    y = 0
    for xx in x:
        y += (a - xx) ** 2
    return y


n = int(input())
x = [int(i) for i in input().split()]
left = min(x)
right = max(x)
while (right - left > 1):
    l = calc(left)
    r = calc(right)
    if (l < r):
        right = (right + left) // 2
    else:
        left = (right + left) // 2
print(r)

### FIXED CODE ###

def calc(a):
    y = 0
    for xx in x:
        y += (a - xx) ** 2
    return y


n = int(input())
x = [int(i) for i in input().split()]
left = min(x)
right = max(x)
while (right - left > 1):
    l = calc(left)
    r = calc(right)
    if (l < r):
        right = (right + left) // 2
    else:
        left = (right + left) // 2
print(min(calc(left), calc(right)))
print(int((int(input())+int(input()))/2))

### FIXED CODE ###

a, b = map(int, input().split())
print((a + b + 1) // 2)
N = int(input())
S = input().strip()
ans= []

for i in range(1, N-1):
    a = S[:i]
    b = S[i+1:]
    for j in a:
        num = 0
        if j in b:
            num += 1
        ans.append(num)
print(max(ans))



### FIXED CODE ###

n = int(input())
s = input()

ans = 0
for i in range(1, n):
    cur = 0
    a = set(s[:i])
    b = set(s[i:])
    for A in a:
        if A in b:
            cur += 1
    ans = max(ans, cur)
print(ans)
import fractions
 
N = int(input())
A = list(map(int,input().split()))
L = [0] * N
R = [0] * N

for i in range(1, N):
    L[i] = math.gcd(L[i-1], A[i-1])
    R[-i-1] = math.gcd(R[-i], A[-i])

ans = [0] * N

for i in range(0, N):
    ans[i] = math. gcd(L[i], R[i])

print(max(ans))

### FIXED CODE ###

import fractions
 
N = int(input())
A = list(map(int,input().split()))
L = [0] * N
R = [0] * N

for i in range(1, N):
    L[i] = fractions.gcd(L[i-1], A[i-1])
    R[-i-1] = fractions.gcd(R[-i], A[-i])

ans = [0] * N

for i in range(0, N):
    ans[i] = fractions.gcd(L[i], R[i])

print(max(ans))
n = int(input())
a = [int(x) for x in input().split(" ")]
b = [int(x) for x in input().split(" ")]


count = 0
for i in range(n-1):
    if a[i] - b[i] < 0:
        count += a[i]
        diff = a[i+1] - (b[i] - a[i]) 
        if diff < 0:
            b[i+1] += a[i+1]
        else:
            count += b[i] - a[i]
            a[i+1] -= b[i] - a[i]
    elif a[i] - b[i] >= 0:
        count += b[i]
        
if b[n-1] - a[n-1] > 0:
    count += a[n-1]
    rest = b[n-1] - a[n-1]
    if rest < a[n]:
        count += rest
    else:
        count += a[n]
else:
    count += b[i]


print(count)

### FIXED CODE ###

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


count = 0
for i in range(n-1):
    if a[i] - b[i] < 0:
        count += a[i]
        diff = a[i+1] - (b[i] - a[i]) 
        if diff < 0:
            b[i+1] += a[i+1]
        else:
            count += b[i] - a[i]
            a[i+1] -= b[i] - a[i]
    elif a[i] - b[i] >= 0:
        count += b[i]

if b[n-1] - a[n-1] > 0:
    count += a[n-1]
    rest = b[n-1] - a[n-1]
    if rest < a[n]:
        count += rest
    else:
        count += a[n]
else:
    count += b[n-1]


print(count)
N,M=[int(i) for i in input() .split()]
# 二次元配列を得られる
A = []
answer=[0]*M
for i in range(M):
    A.append(list(map(int,input().split())))
j=0
for i in range(M):
    if answer[int(A[i][0])-1] == 0:
        answer[int(A[i][0])-1] = int(A[i][1])
    elif answer[int(A[i][0])-1] == int(A[i][1]):
        answer[int(A[i][0])-1] = int(A[i][1])
    else:
        print(-1)
        j=j+1
        break
seisu=0
if j==0 and answer[0]==0:
    j=j+1
    print(-1)
if j==0:
    for i in range(M):
        seisu=answer[i]*(10**(M-i-1))+seisu
    print(seisu)


### FIXED CODE ###

N,M=[int(i) for i in input().split()]
# 二次元配列を得られる
A = []
answer=[-1]*N
for i in range(M):
    A.append(list(map(int,input().split())))
j=0
for i in range(M):
    if answer[int(A[i][0])-1] == -1:
        answer[int(A[i][0])-1] = int(A[i][1])
    elif answer[int(A[i][0])-1] == int(A[i][1]):
        answer[int(A[i][0])-1] = int(A[i][1])
    else:
        print(-1)
        j=j+1
        break
seisu=0
if j==0 and answer[0]==0 and N!=1:
    j=j+1
    print(-1)
if j==0 and (answer[0]==0 or answer[0]==-1) and N == 1:
    j=j+1
    print(0)
if j==0:
    for i in range(N):
        if answer[i]==-1:
            '''
            N = 5 case
            -1,7,-1,9,0
            ?7?90
            5 digits
            17090 
            '''
            if i == 0 :
                answer[0]=1
            else:
                answer[i]=0

        seisu=answer[i]*(10**(N-i-1))+seisu
    print(seisu)
input() # skip
nums = input().split()

reversed_nums = reversed(nums)

print(' '.join(reversed_nums))

### FIXED CODE ###

import math

r = float(input())

area = math.pi * r ** 2
circumference = 2 * math.pi * r

print("%.6f %.6f" % (area, circumference))
A=int(input())
B=int(input())
if A>B:
  print("2A-1")
if A<B:
  print("2B-1")
if A==B:
  print("A+B")

### FIXED CODE ###

A, B = map(int, input().split())
if A>B:
  print(2*A-1)
if A<B:
  print(2*B-1)
if A==B:
  print(A+B)
N = int(input())
A = list(map(int, input().split()))
MINUS = 0
B = []

for i in A:
  if i < 0:
    MINUS += 1
  else:
    B.append(i)
  
if min(A) > 0:
  print(sum(A))
  exit(0)
  
ans = 0
if MINUS % 2 == 0:
  for a in A:
    ans += abs(a)
else:
  mb = min(B)
  mb_flag = True
  for a in A:
    if mb_flag and a == mb:
      mb_flag = False
      continue
    ans += abs(a)
  ans -= mb

print(ans)
  
  


### FIXED CODE ###

N = int(input())
A = list(map(int, input().split()))
MIN_A = min(map(abs, A))
MINUS = 0

for i in A:
  if i < 0:
    MINUS += 1

if min(A) > 0:
  print(sum(A))
  exit(0)
  
ans = 0
if MINUS % 2 == 0:
  for a in A:
    ans += abs(a)
else:
  for a in A:
    ans += abs(a)
  ans -= MIN_A * 2

print(ans)
a, b = (input().split(" "))
a = int(a)
b = int(b)
if(a > b):
  print("GREATER")
elif(a < b):
  print("LESS")
else:
  print("EQUAL")

### FIXED CODE ###

a = input()
b = input()
if(eval(a) > eval(b)):
    print("GREATER")
elif(eval(a) < eval(b)):
    print("LESS")
else:
    print("EQUAL")
N,M = map(int, input().split())
import heapq
A = list(map(int, input().split()))
A = [(-x,x) for x in A]
heapq.heapify(A)
def conf(A, M):
    if M > 0:
        a = heapq.heappop(A)[1]
        heapq.heappush(A, (-int(a/2), int(a/2)))
    else:
        return A
    return conf(A, M-1)
conf(A, M)
B = [a[1] for a in A]
print(sum(B))


### FIXED CODE ###

N,M = map(int, input().split())
import heapq
A = list(map(int, input().split()))
A = [(-x,x) for x in A]
heapq.heapify(A)
for _ in range(M):
    a = heapq.heappop(A)[1]
    heapq.heappush(A, (-int(a/2), int(a/2)))
B = [a[1] for a in A]
print(sum(B))
N = input()
remainder = N % 1000
print(remainder)

### FIXED CODE ###

N = int(input())
if N%1000 == 0:
	print(0)
else:
	print(1000 - N%1000)
red blue
5 5
blue

### FIXED CODE ###

s,t=map(str,input().split())
a,b=map(int,input().split())
u=input()
if s==u:
    a-=1
elif t==u:
    b-=1

print('{} {}'.format(a,b))
from string import ascii_lowercase
s = input()

if s == ascii_lowercase[::-1]:
        print(-1)
elif len(s)!=len(ascii_lowercase):
    s1 = set(list(s))
    s2 = set(list(ascii_lowercase))
    w = min(s2-s1)
    print(s+w)
else:
    a = ''
    res = ''
    tmp = ''
    for i in range(len(s))[::-1]:
        if i==0:
            tmp = s[i]
            a += s[i]
        else:
            if s[i]>tmp:
                a += s[i]
                tmp = s[i]
            else:
                res = s[:i]
                break
    
    m = max(list(res))
    
    tmp = []
    for i in range(len(a)):
        if a[i]>m:
            tmp.append(a[i])
    print(res + min(tmp))

### FIXED CODE ###

from string import ascii_lowercase
s = input()

if s == ascii_lowercase[::-1]:
    print(-1)
elif len(s)!=len(ascii_lowercase):
    s1 = set(list(s))
    s2 = set(list(ascii_lowercase))
    w = min(s2-s1)
    print(s+w)
else:
    back = ''
    tmp = ''
    pos = 0
    for i in range(len(s))[::-1]:
        if i==25:
            back += s[i]
            tmp = s[i]
        elif s[i]>tmp:
            back += s[i]
            tmp = s[i]
        else:
            pos = i
            break
    
    res = s[:pos]
    w = s[pos]
    l = []
    for b in back:
        if b > w:
            l.append(b)
    print(res + min(l))
wihle True:
    a, op, b = map(str, raw_input().split())

    if op in "+":
        print int(a)+int(b) 
    elif op in "-":
        print int(a)-int(b)
    elif op in "*":
        print int(a)*int(b)
    elif op in "/":
        print int(a)/int(b)
    else :
        break;

### FIXED CODE ###

while True:
    a, op, b = map(str, raw_input().split())

    if op in "+":
        print int(a)+int(b) 
    elif op in "-":
        print int(a)-int(b)
    elif op in "*":
        print int(a)*int(b)
    elif op in "/":
        print int(a)/int(b)
    else :
        break;
a = int(input()) 
b = int(input()) 
c = int(input()) 
x = int(input()) 
z = 0 number = 0 
for i in range(a+1):
     for g in range(b+1):
         for h in range(c+1):
             z = 500*i + 100*g + 50*h
             if x == z:
                 number += 1  
print(number)  


### FIXED CODE ###

a = int(input())
b = int(input())
c = int(input())
x = int(input())
z = 0
number = 0
for i in range(a+1):
    for g in range(b+1):
        for h in range(c+1):
            z = 500*i + 100*g + 50*h
            if x == z:
                number += 1

print(number)
import sys
sys.setrecursionlimit(10*9)

def dfs(now):
    for to,dis in G[now]:#next_v[0]=次の頂点、[1]=次までの距離
        if color[to]==-1:
            color[to]= (color[now] + dis) % 2
            dfs(to)

N = int(input())
G = [[] for _ in range(N)]
color = [-1] * N
color[0] = 1 #偶数=０

for i in range(N-1):
    a,b,c = map(int,input().split())
    a -= 1
    b -= 1
    G[a].append([b,c%2])
    G[b].append([a,c%2])

#print(G)    
dfs(0)
print(*color,sep="\n")


### FIXED CODE ###

import sys
sys.setrecursionlimit(10**9)

def dfs(now):
    for to,dis in G[now]:
        if color[to] == -1:
            color[to] = (color[now] + dis) % 2
            dfs(to)

N = int(input())
G = [[] for _ in range(N)]
color = [-1] * N
color[0] = 0 #偶数=0

for i in range(N-1):
    a,b,c = map(int,input().split())
    a -= 1
    b -= 1
    G[a].append([b,c%2])
    G[b].append([a,c%2])

#print(G)    
dfs(0)
print(*color,sep="\n")
from collections import deque
n = int(input())
list_A = list(map(int, input().split()))
ans = deque()
for i in range(n):
    if i % 2 == 0:
        ans.append(list_A[i])
    else:
        ans.insert(0, list_A[i])

if n % 2 == 1:
    ans.reverse()
print(*ans)

### FIXED CODE ###

from collections import deque
n = int(input())
list_A = list(map(int, input().split()))
ans = deque([])
for i in range(n):
    if i % 2 == 0:
        ans.append(list_A[i])
    else:
        ans.appendleft(list_A[i])

if n % 2 == 1:
    ans.reverse()
print(*ans)
import sys
def input():
	return sys.stdin.readline()[:-1]
n = int(input())
words = []
for i in range(n):
	a = int(input())
	w = []
	for _ in range(a):
		x, y = map(int, input().split())
		w.append([x-1, y])
	words.append(w)


ans = 0
for bit in range(1<<n):　#2のn乗まで捜査
	ok = True
	is_honest = [(bit>>i) & 1 for i in range(n)]
	#bitをiずらして末尾が1のひとは正直
	for i in range(n):
		if not is_honest[i]:
			continue
		for x, y in words[i]:
			if is_honest[x] != y:
				ok = False
	if ok:
		ans = max(ans, sum(is_honest))
print(ans)


### FIXED CODE ###

n = int(input())
words = []
for i in range(n):
	a = int(input())
	w = []
	for _ in range(a):
		x, y = map(int, input().split())
		w.append([x-1, y])
	words.append(w)


ans = 0
for bit in range(1<<n):
  #2のn乗まで捜査
	ok = True
	is_honest = [(bit>>i) & 1 for i in range(n)]
	#bitをiずらして末尾が1のひとは正直
	for i in range(n):
		if not is_honest[i]:
			continue
		for x, y in words[i]:
			if is_honest[x] != y:
				ok = False
	if ok:
		ans = max(ans, sum(is_honest))
print(ans)
import numpy as np
 
def prime(n):
    primes = np.zeros(n + 1, dtype=np.bool)
    primes[2] = 1
    primes[3::2] = 1
    for p in range(3, n + 1, 2):
        if primes[p]:
            primes[p * p::2 * p] = 0
    return primes
pp=prime(10**3)
p=[]
for i in range(2,1001):
  if pp[i]:
    p.append(i)
n=int(input())
a=list(map(int,input().split()))
def gcd(x,y):
  while y:
    x,y=y,x%y
  return x

g=a[0]
for i in a[1:]:
  g=gcd(g,i)
if g==1:
  m=[0 for i in range(1001)]
  mm=[0 for i in range(10**6+1)]
  f=True
  for i in a:
    if mm[i]:
      f=False
      break
    mm[i]=1
    for j in range(168):
      if i%p[j]:
        if m[j]:
          f=False
          break
        m[j]=1
    if not f:
      break
  if f:
    print("pairwise coprime")
  else:
    print("setwise coprime")
else:
  print("not coprime")
      

### FIXED CODE ###

def prime(n):
    primes = [0, 1] * (n // 2 + 1)
    if n % 2 == 0:
        primes.pop()
    primes[1] = 0
    primes[2] = 1
    for p in range(3, n + 1, 2):
        if primes[p]:
            for q in range(p * p, n + 1, 2 * p):
                primes[q] = 0
    return primes
pp=prime(10**3)
p=[]
for i in range(2,1001):
  if pp[i]:
    p.append(i)
n=int(input())
a=list(map(int,input().split()))
def gcd(x,y):
  while y:
    x,y=y,x%y
  return x

g=a[0]
for i in a[1:]:
  g=gcd(g,i)
if g==1:
  mm=[0 for i in range(10**6+1)]
  f=True
  for i in a:
    if mm[i] and i!=1:
      f=False
      break
    mm[i]=1
    si=i**0.5
    for j in range(168):
      if p[j]>si:
        break
      if i%p[j]==0 and i!=p[j]:
        if mm[p[j]]:
          f=False
          break
        mm[p[j]]=1
        t=i//p[j]
        if mm[t] and t!=p[j]:
          f=False
          break
        mm[t]=1
    if not f:
      break
  if f:
    print("pairwise coprime")
  else:
    print("setwise coprime")
else:
  print("not coprime")
n = int(input())
dic = {}
for i in range(n):
    a = input()
    if a in dic:
        dic[a] += 1
    else:
        dic[a] = 0

l = sorted(dic.items(), key=lambda x: x[1], reverse=True)
i = 0
while(i<n):
    print(l[i][0])
    if i<n-1:
        if l[i][1] != l[i+1][1]:
            break
    i += 1

### FIXED CODE ###

n = int(input())
dic = {}
for i in range(n):
    a = input()
    if a in dic:
        dic[a] += 1
    else:
        dic[a] = 0

l = sorted(dic.items(), key=lambda x: x[1], reverse=True)
num = l[0][1]
ok = []
for i in range(len(l)):
    if l[i][1] == num:
        ok.append(l[i][0])
    else:
        break
ok.sort()
for i in ok:
    print(i)
s=input()
k=int(input())
a={}
for i in range(k):
  for j in range(len(s)-i):a.append(s[j:j+i+1])
print(sorted(list(a))[k-1])

### FIXED CODE ###

s=input()
k=int(input())
a={s}
for i in range(k):
  for j in range(len(s)-i):a.add(s[j:j+i+1])
print(sorted(list(a))[k-1])
N=list(input())
for i,j in range(N):
  N[i],N[j]=N[j],N[i]
  if N==N.sort():
    print("YES")
    break
else:
  print("NO")

### FIXED CODE ###

N=int(input())
l=list(map(int,input().split()))
a=list(range(1,N+1))
count=0
for i in range(0,len(l)):
  if l[i]==a[i]:
    count+=1
if count >= N-2:
  print("YES")
else:
  print("NO")
N = int(input())

for x in range(N//2):
    for y in range(N//2):
        if x*4 + y*7 == N:
            flag = True
            

print("Yes") if flag else print("No")

### FIXED CODE ###

N = int(input())

count = 0

for x in range(0,N):
    for y in range(0,N):
        if x*4 + y*7 == N:
            count += 1
            
           
            

print("No") if count == 0 else print("Yes")
a=input()
if a[0]==c[2]:
  print("Yes")
else:
  print("No")

### FIXED CODE ###

a=input()
if a[0]==a[2]:
  print("Yes")
else:
  print("No")
n,t=map(int,input().split())
li=[]
for i in range(n):
  c,tt=map(int,input().split())
  if tt>t:
    continue
  li.append(c)
print(min(li))

### FIXED CODE ###

n,t=map(int,input().split())
li=[]
for i in range(n):
  c,tt=map(int,input().split())
  if tt>t:
    continue
  li.append(c)
if len(li)==0:
  print("TLE")
else:
  print(min(li))
a,b=map(int,input().split())
    print(max(a+b,2*a-1,2*b-1))

### FIXED CODE ###

a,b=map(int,input().split())
print(max(a+b,2*a-1,2*b-1))
N, W = map(int, input().split())
dp = [[0] * (W + 1) for i in range(N+1)]
for i in range(N):
  w, v = map(int, input().split())
  for j in range(W+1):
      if j - w >= 0:
        dp[i+1][j] = max(dp[i][j], dp[i][j-w] + v)
      else:
        dp[i+1][j] = dp[i][j]
print(max(dp[N]))

### FIXED CODE ###

n,w=map(int, input().split())
m=10**5+1
x=[list(map(int, input().split())) for i in range(n)]
dp=[[float('inf')]*m for i in range(n+1)]
dp[0][0]=0
for i in range(n):
    for j in range(m):
        if j>=x[i][1]:
            dp[i+1][j]=min(dp[i][j],dp[i][j-x[i][1]]+x[i][0])
        else:
            dp[i+1][j]=dp[i][j]
ans=0
for i in range(m):
    if dp[-1][i]<=w:ans=max(ans,i)
print(ans)
s=list(input())
n=len(s)
sum=0
ans=[]
check=["A","T","C","G"]
for i in range(n):
  if s[i] in check:
    sum=sum+1
  else:
    ans.append(sum)
    sum=0
print(max(ans))

### FIXED CODE ###

s=list(input())
n=len(s)
sum=0
ans=0
check=["A","T","C","G"]
for i in range(n):
  if s[i] in check:
    sum=sum+1
  else:
    ans=max(ans,sum)
    sum=0
print(max(ans,sum))
N, K = map(int, input().split())
 
tmp = [0] * N
 
for i in range(K):
  input()
  for j in set(map(int, input().split()))
 	tmp[j] |= 1 
print(sum(tmp))

### FIXED CODE ###

N, K = map(int, input().split())
 
tmp = set()
 
for i in range(K):
  input()
  tmp |= set(map(int, input().split()))
 
print(len(set(range(1, N+1)) - tmp))