Harryxun/stf_run huggingface dataset:
# coding: utf-8

import sys
input = sys.stdin.readline

def f(N, A, K):
    dp = [0] * (K + 1)
    mina = min(A)
    minmax = mina + max(A)
    for i in range(mina, minmax):
        for x in A:
            i_ = i - x
            dp[i] = 1 if i_ < mina else dp[i_] ^ 1
            if dp[i]:
                break
    for i in range(minmax, K + 1):
        for x in A:
            dp[i] = dp[i - x] ^ 1
            if dp[i]:
                break
    return(dp[K])

ans = [ "Second", "First" ]
n, k = map(int, input().split()) # 1 <= n <= 100, 1 <= k <= 10^5
a = list(map(int, input().split()))
print(ans[f(n, a, k)])


### FIXED CODE ###

# coding: utf-8

import sys
input = sys.stdin.readline

def f(N, A, K):
    dp = [0] * (K + 1)
    for i in range(K + 1):
        for x in A:
            if i < x:
                break
            if not dp[i - x]:
                dp[i] = 1
                break
    return(dp[K])

ans = [ "Second", "First" ]
n, k = map(int, input().split()) # 1 <= n <= 100, 1 <= k <= 10^5
a = list(map(int, input().split()))
print(ans[f(n, a, k)])
H,W = map(int,input().split())

ban = []

for j in range(W):
  ban.append(0)

banmen=[]

for i in range(H):
  banmen.append(ban)
  
banmen[0][0] = 1
cnt = 1

for i in range(H):
  for j in range(W):
    if banmen[i][j] != 1:
      continue
    if i-1 >= 0 and j-1 >= 0 and banmen[i-1][j-1] != 1:
      banmen[i-1][j-1] = 1
      cnt+=1
    elif i-1 >= 0 and j+1 <= len(ban) and banmen[i-1][j+1] != 1:
      banmen[i-1][j+1] = 1
      cnt+=1
    elif i+1 <= H and j-1 >= 0 and banmen[i+1][j-1] != 1:
      banmen[i+1][j-1] = 1
      cnt+=1
    elif i+1 <= H and j+1 <= W and banmen[i+1][j+1] != 1:
      banmen[i+1][j+1] = 1
      cnt+=1
print(cnt)

### FIXED CODE ###

H,W = map(int,input().split())
 
if H == 1 or W == 1:
  print(1)
else:
  cnt = (H * W + 1) // 2
  print(cnt)
x = input()
print( x*x*x)


### FIXED CODE ###

x = int( input() )
print( x*x*x)
n,a,b = map(int,input().split())

mod = 10**9+7
def modinv(a, mod=10**9+7):
    return pow(a, mod-2, mod)

fac = [0]*(n+1)
fac[0] = 1
fac[1] = 1
for i in range(2,n+1):
    fac[i] = fac[i-1] * i % mod

c = 0
if n % 2 == 0:
    for i in range(1,n//2 ):
        c += ( fac[n] * modinv(fac[i]) )%mod * modinv(fac[n-i]) % mod
        c = c % mod
    c *= 2
    c += ( fac[n] * modinv(fac[n//2]) )%mod * modinv(fac[n-n//2]) % mod
    c -= ( fac[n] * modinv(fac[a]) )%mod * modinv(fac[n-a]) % mod
    c -= (fac[n] * modinv(fac[b])) % mod * modinv(fac[n-b]) % mod
    c += 1
    c = c % mod
else:
    for i in range(1, n // 2 + 1):
        c += (fac[n] * modinv(fac[i])) % mod * modinv(fac[n - i]) % mod
        c = c % mod
    c *= 2
    c -= (fac[n] * modinv(fac[a])) % mod * modinv(fac[n - a]) % mod
    c -= (fac[n] * modinv(fac[b])) % mod * modinv(fac[n - b]) % mod
    c += 1
    c = c % mod

print(c)

### FIXED CODE ###

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

mod = 10**9+7
def modinv(a, mod=10**9+7):
    return pow(a, mod-2, mod)

def com(n,k,mod=10**9+7):
    u = 1
    s = 1
    for i in range(n,n-k,-1):
        u = u*i % mod
    for i in range(k,0,-1):
        s = s*i % mod
    return u * modinv(s)

c = pow(2,n,mod)
c -= 1
c -= com(n,a)
c -= com(n,b)
print(c%mod)
s=list(input())
s2=[]
for i in range(len(s)):
    if s[-i-1]!="x":
        num=i+1
        break
s3=["O"]*num
for i in range(len(s)):
    if s[i]!="x":
        s2.append(s[i])
        if i!=len(s)-1:
            if s[i+1]!="x":
                s3.append("O")
    else:
        s3.append("x")
num=0
for i in range(len(s2)//2):
    if s2[i]!=s2[-1-i]:
        num=1
        break
if num==1:
    print(-1)
else:
    ans=0
    for i in range(len(s3)//2):
        if s3[i]!=s3[-i-1]:
            ans+=1
    print(ans)


### FIXED CODE ###

s=list(input())
ans=0
for i in range(len(s)):
    if len(s)<=1:
        break
    if s[0]==s[-1]:
        del s[0]
        del s[-1]
    else:
        if s[0]=="x":
            ans+=1
            del s[0]
        elif s[-1]=="x":
            ans+=1
            del s[-1]
        else:
            ans=-1
            break
print(ans)
A=int(input())
B=int(input())
C=int(input())
X=int(input())

an=X/A
bn=X/B
cn=X/C

counter = 0

for i in range(an):
  for j in range(bn):
    for k in range(cn):
      x = 500*i+100*j+50*k
      if X == x:
        counter += 1
print(counter)

### FIXED CODE ###

A=int(input())
B=int(input())
C=int(input())
X=int(input())

 
counter = 0
 
for i in range(A+1):
  for j in range(B+1):
    for k in range(C+1):
      x = 500*i+100*j+50*k
      if X == x:
        counter += 1
print(counter)
N,M =map(int,input().split())
A = [0]*(N*M*2)
B = [0]*M
C = [0]*M
ans = int(0)

A = list(map(int, input().split()))
for i in range(M):
    B[i],C[i] = list(map(int,input().split()))
    for j in range(B[i]):
        A.append(C[i])

A.sort()

S = int(N)

for i in range(M):
    S +=B[i]

for i in range(S-1,S-N-1,-1):
    ans += A[i]

print(ans)


### FIXED CODE ###

from heapq import heappush, heappop

# input
N,M =map(int,input().split())
A = [0]*N
B = [0]*M
C = [0]*M

A = list(map(int, input().split()))
A.sort()
for i in range(M):
    B[i],C[i] = list(map(int,input().split()))


def solve():

    pairs = zip(C, B)
    sortedpairs = sorted(pairs, key=lambda x: x[0])
    for i in range(M):
        B[i]=sortedpairs[i][1]
        C[i]=sortedpairs[i][0]

    ansA=[0]*N
    for j in range(N):
        ansA[j] = A[j]

    p = int(0)
    j = int(0)
    while  j<N and M>=1+p :
        jd = int(0)
        if ansA[j] >= C[M - 1 - p]:
            break
        while  B[M-1-p]-jd>0 :
            if j==N : break
            if ansA[j]>=C[M-1-p] :
                break
            else:
                ansA[j]=C[M-1-p]
            jd +=1
            j +=1

        p +=1

    ans = int(0)
    for j in range(N):
        ans += ansA[j]

    print(ans)

solve()
a,b,c=map(int,input())
print(a+b+c-max(a,b,c))

### FIXED CODE ###

a,b,c=map(int,input().split())
print(a+b+c-max(a,b,c))
a=int(input())
b=int(input())
if(a>b):
  print(2a-1)
else if(a=b):
  print(2a)
else:
  print(2b-1)


### FIXED CODE ###

a,b=map(int, input().split())
if a>b:
  print(2*a-1)
elif a==b:
  print(2*a)
else:
  print(2*b-1)
N=int(input())
S=input()
K=int(input())

for i in range(len(S)):
  if S[i]!=S[K-1]:
    S[i]="*"
print(S)

### FIXED CODE ###

N=int(input())
S=list(input())
K=int(input())

for i in range(len(S)):
  if S[i]!=S[K-1]:
    S[i]="*"
print(*S,sep="")
import random

def is_prime(q,k=50):
    if q == 2: return True
    if q < 2 or q&1 == 0: return False
    d = (q-1)>>1
    while d&1 == 0:
        d >>= 1
    for i in range(k):
        a = random.randint(1,q-1)
        t = d
        y = pow(a,t,q)
        while t != q-1 and y != 1 and y != q-1: 
            y = pow(y,2,q)
            t <<= 1
        if y != q-1 and t&1 == 0:
            return False
    return True

n,m=(int(i) for i in input().split(' '))
if n<1000:
  for i in range(1,n):
    if m%i==0 and (is_prime(i) or i=1) and is_prime(m//i) and (i==1 or m//i<n):
      print('1')
      exit()
for i in range(n,m+1):
  if i==m:
    print(1)
    break
  if m%i==0:
    print(m//i)
    break
  if m-i-n>0 and m%(m-i-n)==0 and m//(m-i-n)>n:
    print(m-i-n)
    break


### FIXED CODE ###

import random

def is_prime(q,k=50):
    if q == 2: return True
    if q < 2 or q&1 == 0: return False
    d = (q-1)>>1
    while d&1 == 0:
        d >>= 1
    for i in range(k):
        a = random.randint(1,q-1)
        t = d
        y = pow(a,t,q)
        while t != q-1 and y != 1 and y != q-1: 
            y = pow(y,2,q)
            t <<= 1
        if y != q-1 and t&1 == 0:
            return False
    return True

n,m=(int(i) for i in input().split(' '))
for i in range(1,n):
  if m%i==0 and (is_prime(i) or i==1) and is_prime(m//i) and (i==1 or m//i<n):
    print('1')
    exit()
for i in range(n,m+1):
  if i==m:
    print(1)
    break
  if m%i==0:
    print(m//i)
    break
  if m-i-n>0 and m%(m-i-n)==0 and m//(m-i-n)>n:
    print(m-i-n)
    break
N=int(input())
X=[int(x) for x in input().split(" ")]
cons=lambda P:sum([(x-P)**2 for x in X])
print(min([cons(P) for P in range(min(X),max(X))]))


### FIXED CODE ###

N=int(input())
X=[int(i) for i in input().split(" ")]
sp=lambda P:sum([(Xi-P)**2 for Xi in X])
print(min([sp(p) for p in range(0,102)]))
N = int(input())
A = list(map(int, input()))

rev = []
for a in A:
    rev.append(1/float(a))

print(1/sum(rev))

### FIXED CODE ###

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

rev = []
for a in A:
  rev.append(1.0/float(a))
  
print(1.0/float(sum(rev)))
def check(p):
    s = w[0]
    track = 1
    for i in range(1, n):
        if s + w[i] <= p:
            s += w[i]
        else:
            track += 1
            if track > k: return False
            s = w[i]
    return True

n, k = map(int, input().strip().split())
w = []
for i in range(n):
    w.append(int(input()))

L = max(w)
if check(L): return L
R = sum(w)

while L + 1 < R:
    M = (L + R) // 2
    if check(M):
        R = M
    else:
        L = M

print(R)

### FIXED CODE ###

def check(p):
    s = w[0]
    track = 1
    for i in range(1, n):
        if s + w[i] <= p:
            s += w[i]
        else:
            track += 1
            if track > k: return False
            s = w[i]
    return True

n, k = map(int, input().strip().split())
w = []
for i in range(n):
    w.append(int(input()))

L = max(w)
if check(L):
    print(L)
else:
    R = sum(w)
    assert check(R)

    while L + 1 < R:
        M = (L + R) // 2
        if check(M):
            R = M
        else:
            L = M

    print(R)
import re
import sys
import math
import itertools
import bisect
from copy import copy
from collections import deque,Counter
from decimal import Decimal
import functools
def v(): return input()
def k(): return int(input())
def S(): return input().split()
def I(): return map(int,input().split())
def X(): return list(input())
def L(): return list(input().split())
def l(): return list(map(int,input().split()))
def lcm(a,b): return a*b//math.gcd(a,b)
sys.setrecursionlimit(10 ** 9)
mod = 10**9+7
cnt = 0
ans = 0
inf = float("inf")

n,k=I()
a = l()
town = []
num = [0]*(n+1)
cnt = 1
num[0]=1

for i in range(n):
    num[a[cnt-1]] += 1
    if num[a[cnt-1]] == 2:
        ans = a[cnt-1]
        break
    town.append(a[cnt-1])
    cnt = a[cnt-1]

p = town.index(ans)
b = town[p-1:]
x = len(town)
y = len(b)
q = k-x+y
if y == 0:
    print(town[n-1])
    sys.exit()
if q < 0:
    print(town[k-1])
    sys.exit()
z = q%y
if z == 0:
    print(town[k-1])
else:
    print(b[z-1])


### FIXED CODE ###

import re
import sys
import math
import itertools
import bisect
from copy import copy
from collections import deque,Counter
from decimal import Decimal
import functools
def v(): return input()
def k(): return int(input())
def S(): return input().split()
def I(): return map(int,input().split())
def X(): return list(input())
def L(): return list(input().split())
def l(): return list(map(int,input().split()))
def lcm(a,b): return a*b//math.gcd(a,b)
sys.setrecursionlimit(10 ** 9)
mod = 10**9+7
cnt = 0
ans = 0
inf = float("inf")

n,k=I()
a = l()
town = []
num = [0]*(n+1)
cnt = 1
num[0]=1

for i in range(n):
    num[a[cnt-1]] += 1
    if num[a[cnt-1]] == 2:
        ans = a[cnt-1]
        p = town.index(ans)
        b = town[p:]
        x = len(town)
        y = len(b)
        q = k-x+y
        if y == 0:
            print(town[n-1])
            sys.exit()
        if q < 0:
            print(town[k-1])
            sys.exit()
        z = q%y
        if z == 0:
            print(town[z-1])
        else:
            print(b[z-1])
        sys.exit()
        break
    town.append(a[cnt-1])
    cnt = a[cnt-1]
n, m, k = map(int, input().split())
a = list(map(int, input().split()))
b = list(map(int, input().split()))

if k < a[0] and k < b[0]:
    print(0)
    exit()

if k < a[0] and k >= b[0]:
    for i in range(len(b)):
        k -= b[i]
        if k < 0:
            print(i)
            exit()
        if i == len(b)-1:
            print(m)
            exit()

if k >= a[0] and k < b[0]:
    for i in range(len(a)):
        k -= a[i]
        if k < 0:
            print(i)
            exit()
        if i == len(a)-1:
            print(n)
            exit()

i = 0
j = 0
c = []

while True:
    if a[i] <= b[j]:
        c.append(a[i])
        i += 1
        if i == n -1:
            if j == m -1:
                break
            else:
                for l in range(j, m):
                    c.append(b[l])
                break
    else:
        c.append(b[j])
        j += 1
        if j == m -1:
            if i == n -1:
                break
            else:
                for l in range(i, m):
                    c.append(a[l])
                break

for i in range(len(c)):
    k -= c[i]
    if k < 0:
        print(i)
        exit()
    if i == len(c)-1:
        print(len(c))
        exit()

### FIXED CODE ###

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

best = 0

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

ans , j = 0, M

for i in range(N +1):
    if a[i] > K:
        break
    while b[j] > K -a[i]:
        j -= 1
    ans = max(ans, i +j)
print(ans)
import math
h, w, d = list(map(int, input().split()))
grid = []
num = [[] for i in range(h*w+1)]
graph = [[0 for i in range(w+1)] for j in range(h+1)]
for i in range(h):
    grid.append(list(map(int, input().split())))
for i in range(h):
    for j in range(w):
        num[grid[i][j]]=[j+1, i+1]
k = math.ceil((h*w) / d)
#initialize
cost = [[0 for i in range(k)] for j in range(d)]
for i in range(d):
    cost[i][0] = 0
for i in range(d + 1,h*w+1):
    x, y = num[i]
    prex, prey = num[i - d]
    cost[i % d][i//d] = abs(prex - x) + abs(prey - y)
    cost[i % d][i//d] += cost[i % d][(i - d)// d]  
q = int(input())
for i in range(q):
    l, r = map(int, input().split())
    print(cost[r%d][r//d] - cost[l%d][l//d])


### FIXED CODE ###

import math
h, w, d = list(map(int, input().split()))
grid = []
num = [[] for i in range(h*w+1)]
for i in range(h):
    grid.append(list(map(int, input().split())))
for i in range(h):
    for j in range(w):
        num[grid[i][j]]=[j+1, i+1]
k = math.ceil((h*w+1) / d)
#initialize
cost = [[0 for i in range(k)] for j in range(d)]
for i in range(d + 1,h*w+1):
    x, y = num[i]
    prex, prey = num[i - d]
    cost[i % d][i//d] = abs(prex - x) + abs(prey - y)
    cost[i % d][i//d] += cost[i % d][(i - d)// d]
q = int(input())
for i in range(q):
    l, r = map(int, input().split())
    print(cost[r%d][r//d] - cost[l%d][l//d])
from collections import Counter


def solve(V):
    n = len(V)
    odd = Counter()
    even = Counter()
    total = Counter()
    for i, c in enumerate(V):
        total.update([c])
        if i % 2 == 0:
            even.update([c])
        else:
            odd.update([c])

    total_max = total.most_common()[0]
    if total_max[1] == len(V):
        return len(V) / 2

    even_maxs = even.most_common(2)
    odd_maxs = odd.most_common(2)
    if len(odd_maxs) > 1:
        odd_max, odd_2nd_max = odd_maxs[0], odd_maxs[1]
    else:
        odd_max, odd_2nd_max = odd_maxs[0], None

    if len(even_maxs) > 1:
        even_max, even_2nd_max = even_maxs[0], even_maxs[1]
    else:
        even_max, even_2nd_max = even_maxs[0], None

    ans = 0
    if odd_max[0] != even_max[0]:
        odd_max = odd_max[0]
        even_max = even_max[0]
    elif odd_2nd_max != None and even_2nd_max == None:
        even_max = even_max[0]
        odd_max = odd_2nd_max[0]
    elif odd_2nd_max == None and even_2nd_max != None:
        odd_max = odd_max[0]
        even_max = even_2nd_max[0]
    else:  # odd_2nd_max != None and even_2nd_max != None:
        return n - max(even_maxs[0][1] + odd_maxs[1][1], 
                       even_maxs[1][1] + odd_maxs[0][1])

    for key, count in even.items():
        if key != even_max:
            ans += count
    for key, count in odd.items():
        if key != odd_max:
            ans += count
    return ans


if __name__ == "__main__":
    n = int(input())
    l = input()
    print(solve(l.split(" ")))


### FIXED CODE ###

def solve(N):
    return l.replace("1", "8").replace("9", "1").replace("8", "9")

if __name__ == "__main__":
    l = input()
    print(solve(l))
N=int(input())
x=N/1000
if N/1000%=0:
  x=int(x)
else:
  x=int(x)+1
y=1000*x
print(y-N)

### FIXED CODE ###

N=int(input())
x=N/1000
if N%1000==0:
  x=int(x)
else:
  x=int(x)+1
y=1000*x
print(y-N)
s = input()
a = [int(c) for c in s]

if bool(a[0]!=7 and a[1]!=7 and a[2]!=7:
        print("No")
else
        print("Yes")

### FIXED CODE ###

s = input()
a = [int(c) for c in s]

if bool(a[0]!=7 and a[1]!=7 and a[2]!=7):
        print("No")
else:
        print("Yes")
A = map(int, input().split())
while (A>0 and C>0):
    C = C - B
    if C <= 0:
        break
    A = A - D
print("Yes" if C<=0 else "NO")

### FIXED CODE ###

A, B, C, D = map(int, input().split())
while (A>0 and C > 0):
    C = C - B
    if C <= 0:
        break
    A = A - D
print("Yes" if C<=0 else "No")
a = int(input())
print(3.14１５ * a *a)


### FIXED CODE ###

a = int(input())
print(3.14159265 * a * 2)
L=list(map(int,input().split()))
A=L[0]-L[1]
B=L[0]-L[2]
if min(A,B)=A:
	print("A")
else:
	print("B")

### FIXED CODE ###

L=list(map(int,input().split()))
A=abs(L[0]-L[1])
B=abs(L[0]-L[2])
if min(A,B)==A:
	print("A")
else:
	print("B")
from collections import deque
from itertools import chain

H, W = map(int, input().split())
M = [list(input()) for _ in range(H)]
inf = float('inf')


def flatten(list_of_lists):
    return chain.from_iterable(list_of_lists)


def bfs(start, end):
    distance = [[inf for i in range(W)] for j in range(H)]
    queue = deque((end, start))
    distance[end][start] = 0

    while queue:
        y, x = queue.pop()
        for i in range(0, 4):
            nx, ny = x + [1, 0, -1, 0][i], y + [0, 1, 0, -1][i]
            if 0 <= nx < W and 0 <= ny < H and M[ny][nx] != '#' and distance[ny][nx] == inf:
                queue.insert(0, (ny, nx))
                distance[ny][nx] = distance[y][x] + 1
    return distance


m = 0
for i in range(W):
    for j in range(H):
        if M[j][i] != "#":

            for length in list(flatten(bfs(i, j))):
                if length != inf and m < length:
                    m = length

print(m)


### FIXED CODE ###


from itertools import chain

H, W = map(int, input().split())
M = [list(input()) for _ in range(H)]
inf = float('inf')

def flatten(list_of_lists):
    "Flatten one level of nesting"
    return chain.from_iterable(list_of_lists)


def bfs(start, end):
    distance = [[inf for i in range(W)] for j in range(H)]
    queue = [(end, start)]
    distance[end][start] = 0

    while queue:
        y, x = queue.pop()
        for i in range(0, 4):
            nx, ny = x + [1, 0, -1, 0][i], y + [0, 1, 0, -1][i]
            if 0 <= nx < W and 0 <= ny < H and M[ny][nx] != '#' and distance[ny][nx] == inf:
                queue.insert(0, (ny, nx))
                distance[ny][nx] = distance[y][x] + 1
    return distance


m = 0
for i in range(W):
    for j in range(H):
        if M[j][i] != "#":

            for length in list(flatten(bfs(i, j))):
                if length != inf and m < length:
                    m = length

print(m)
a,b = map(int,input().split())
import fractions as fr
g = fr.gcd(a,b)
print(int(a*b/g))

### FIXED CODE ###

a = int(input())
b = int(input())
print(6-a-b)
W, H, N = map(int, input().spllit())
a = [list(map(int, input().split())) for i in range(N)]
x, y = 0, 0
for i in a:
    if (i[2]==1) and (x < i[0]):
        x = i[0]
    elif (i[2]==2) and (W > i[0]):
        W = i[0]
    elif (i[2]==3) and (y < i[1]):
        y = i[1]
    elif (i[2]==4) and (H > i[1]):
        H = i[1]
if ((W-x)<=0) or ((H-y)<=0):
    print(0)
else:
    print((W-x)*(H-y))

### FIXED CODE ###

W,H,N = map(int, input().split())
p = [list(map(int, input().split())) for i in range(N)]
x, y = 0, 0
for i in p:
    if (i[2] == 1) and (x < i[0]):
        x = i[0]
    elif (i[2] == 2) and (W > i[0]):
        W = i[0]
    elif (i[2] == 3) and (y < i[1]):
        y = i[1]
    elif (i[2] == 4) and (H > i[1]):
        H = i[1]
area = (W-x)*(H-y)
if ((W-x) <= 0) or ((H-y) <= 0):
    print(0)
else:
    print(area)
def binary(l,c,low,index):
    fst = 0
    last = len(l)
    mid = int(last/2)
    if fst == 0 and last ==0:
        l.insert(0,c)
        for i in range(len(index)):
            if low[i] > c:
                index[i] += 1
        return
    while fst < last:
        mid = int((fst+last) / 2)
        if l[mid] == c:
            return
        elif last == mid:
            break
        elif fst == mid:
            break
        elif l[mid] >= c:
            last = mid
        elif l[mid] <= c:
            fst = mid
    if l[mid] < c:
        mid+=1
    l.insert(mid,c)
    for i in range(len(index)):
        if low[i] > c:
            index[i] += 1

q = int(input())
S = []
a = []
low = []
for i in range(q):
    a.append(list(map(int,input().split())))
    if a[i][0] == 3:
        low.append(a[i][1])

index = [0]*len(low)

for i in range(q):
    if a[i][0] == 0:
        binary(S,a[i][1],low,index)
        print(len(S))
    elif a[i][0] == 1:
        if a[i][1] in S:
            print(1)
        else:
            print(0)
    elif a[i][0] == 2:
        if a[i][1] in S:
            S.remove(a[i][1])
            for b in range(len(index)):
                if low[b] > a[i][1]:
                    index[b] -= 1
    else:
        if index[0] < len(S)1:
            for b in range(index[0],len(S)):
                if S[b] <= a[i][2]:
                    print(S[b])
                else:
                    del low[0]
                    del index[0]
                    break
        else:
            del low[0]
            del index[0]


### FIXED CODE ###

from bisect import bisect_left, bisect_right, insort_left

q = int(input())
S = []
D = {}
a = []
c = 0
for i in range(q):
    a.append(list(map(int,input().split())))

for i in range(q):
    if a[i][0] == 0:
        if not a[i][1] in D:
            insort_left(S,a[i][1])
            D[a[i][1]] = 1
            c += 1
        else:
            if not D[a[i][1]] == 1:
                D[a[i][1]] = 1
                c += 1
        print(c)
    elif a[i][0] == 1:
        if a[i][1] in D:
            if D[a[i][1]] == 1:
                print(1)
            else:
                print(0)
        else:
            print(0)
    elif a[i][0] == 2:
        if a[i][1] in D:
            if D[a[i][1]] == 1:
                D[a[i][1]] = 0
                c -= 1
    else:
        L = bisect_left(S,a[i][1])
        R = bisect_right(S,a[i][2])
        for j in range(L,R):
            if D[S[j]] == 1:
                print(S[j])
if __name__ == '__main__':
  a,b,c=(int(x) for x in input().split())
  if(sum(a,b,c)>=22):
    print("bust")
  else:
    print("win")

### FIXED CODE ###

if __name__ == '__main__':
  line=[int(x) for x in input().split()]
  if(sum(line)>=22):
    print("bust")
  else:
    print("win")
a,b = map(int,input().split(" "))
if a+b==15:
  print("+")
else if a*b==15:
  print("*")
else:
  print("x")


### FIXED CODE ###

a,b = map(int,input().split(" "))
if a+b==15:
  print("+")
elif a*b==15:
  print("*")
else:
  print("x")
a, b = map(str, input().split())

c = a + b
c = int(c)

for i in range(400)[1:]:
    if c = i**2:
        print('Yes')
        break

print('No')


### FIXED CODE ###

a, b = map(str, input().split())

c = a + b
c = int(c)

for i in range(400)[1:]:
    if c == i**2:
        print('Yes')
        exit()

print('No')