Harryxun/stf_run huggingface dataset:
n=int(input())
a=list(map(int,input().split()))
x=max(a)
y=a.index(x)
for i in range(0,n):
  if i!=y:
    print(x)
  else:
    del a(x)
    print(max(a))
  

### FIXED CODE ###

n=int(input())
a=[]

for j in range(0,n):
  a.append(int(input()))
  
x=max(a)
y=a.index(x)
del a[y]
z=max(a)

for i in range(0,n):
  if i!=y:
    print(x)
  else:
    print(z)
K=int(input())
S=input()
A=len(S)
if A=K:
  print(S)
if A>K:
  print(S[0:K:1]+'...')
  
  


### FIXED CODE ###

K=int(input())
S=input()
A=len(S)
if A<=K:
  print(S)
if A>K:
  print(S[0:K:1]+'...')
N=int(input())
A=list(map(int,input().split()))
B=[]
C=[]
for i in range(N):
    if A[i]<=0:
        B.append(-A[i])
    else:
        C.append(A[i])
if len(B)%2==0:
       print(sum(B)+sum(C))
else:
       print(sum(B)+sum(C)-2*min(min(B),min(C)))

### FIXED CODE ###

N=int(input())
A=list(map(int,input().split()))
B=[]
C=[]
for i in range(N):
    if A[i]<=0:
        B.append(-A[i])
    else:
        C.append(A[i])
if len(B)%2==0:
       print(sum(B)+sum(C))
else:
        if C==[]:
            print(sum(B)+sum(C)-2*min(B))
        else:
            print(sum(B)+sum(C)-2*min(min(B),min(C)))
import math
Q = int(input())

def sosuu(x):
  if x == 1:
    return False
  else:
    for i in range(1,int(math.sqrt(x))):
      if x % (i+1) == 0:
        return False
    return True

table=[0]*50001
for i in range(1,50001):
  if i%2==1 and sosuu((i+1)//2) and sosuu(i):
    table[i]=table[i-1] + 1
  else:
    table[i]=table[i-1]
#print(table[0:10])
ans=[0]*Q
for i in range(Q):
  l,r=map(int,input().split())
  ans[i]=table[r] - table[l-1]
  
for i in range(Q):
  print(ans[i])

### FIXED CODE ###

import math
Q = int(input())

def sosuu(x):
  if x == 1:
    return False
  else:
    for i in range(1,int(math.sqrt(x))):
      if x % (i+1) == 0:
        return False
    return True

table=[0]*100001
for i in range(1,100001):
  if i%2==1 and sosuu(int((i+1)/2)) and sosuu(i):
    table[i]=table[i-1] + 1
  else:
    table[i]=table[i-1]
#print(table[0:10])
ans=[0]*Q
for i in range(Q):
  l,r=map(int,input().split())
  ans[i]=table[r] - table[l-1]
  
for i in range(Q):
  print(ans[i])
n = int(input())
s = str(input())
ans = 0
for i in range(1,len(s)):
    #print(t[:i], t[i:])
    left = set(list(t[:1]))
    right = set(list(t[i:]))
    kyoutuu = left & right
    y = len(list((1,2,3)))
    ans = max(ans,y)
print(y)

### FIXED CODE ###

n = int(input())
t = str(input())
ans = 0
for i in range(1,len(t)):
    #print(t[:i], t[i:])
    left = list(t[:i])
    right = list(t[i:])
    #print(left,right)
    kyoutuu = set(left) & set(right)
    j = len(list(kyoutuu))
    if ans < j:
        ans = j
print(ans)
n = int(input())
a = list(map(int,input().split()))
so_list = [0 for i in range(10**4)]
mod = 10**9+7

def fac(n):
    temp = n
    for i in range(2, int(-(-n**0.5//1))+1):
        if temp%i==0:
            cnt=0
            while temp%i==0:
                cnt+=1
                temp //= i
            if so_list[i]<cnt:
              so_list[i]= cnt
    if temp!=1:
      if so_list[temp]==0:
        so_list[temp]=1
for i in range(n):
  a1 = a[i]
  fac(a1)
l = 1
for i in range(len(so_list)):
  if so_list[i]!=0:
    l *= pow(i,so_list[i],mod)
    l %= mod
ans = 0
#print(l)
for i in a:
  t = pow(i,mod-2,mod)
  ans += (l*t)%mod
print(ans%mod)

### FIXED CODE ###

n = int(input())
a = list(map(int,input().split()))
so_list = [0 for i in range(10**6)]
mod = 10**9+7

def fac(n):
    temp = n
    for i in range(2, int(-(-n**0.5//1))+1):
        if temp%i==0:
            cnt=0
            while temp%i==0:
                cnt+=1
                temp //= i
            if so_list[i]<cnt:
              so_list[i]= cnt
    if temp!=1:
    #  print(temp)
      if so_list[temp]==0:
        so_list[temp]=1
for i in range(n):
  a1 = a[i]
  fac(a1)
l = 1
for i in range(len(so_list)):
  if so_list[i]!=0:
    l *= pow(i,so_list[i],mod)
    l %= mod
ans = 0
#print(l)
for i in a:
  t = pow(i,mod-2,mod)
  ans += (l*t)%mod
print(ans%mod)
X,Y=map(str, input().split())
str_list = 'abcdef'
x=str_list.index(X)
y=str_list.index(Y)
if x<y : print('<')
if x==y: print('=')
if x>y : print('>')

### FIXED CODE ###

X,Y=map(str, input().split())
str_list = 'ABCDEF'
x=str_list.index(X)
y=str_list.index(Y)
if x<y : print('<')
if x==y: print('=')
if x>y : print('>')
a,b=map(int,input().split())
if a%2==0 or b%==0:
  print("Yes")
else:
  print("No")

### FIXED CODE ###

a,b=map(int,input().split())
if a%2==1 and b%2==1:
  print("Yes")
else:
  print("No")
a,b=int(input())
for x in input().split():
  print(x)

### FIXED CODE ###

n,k,*_=map(int,open(0).read().split())
print(0--~-n//~-k)
A,B,K = map(int, input().split())

if A>=K:
    print(A-K, B)
elif B>=K-A:
    print(0, b-K+A)
else:
    print(0,0)

### FIXED CODE ###

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

if A>=K:
    print(A-K, B)
elif B>=K-A:
    print(0, B-K+A)
else:
    print(0,0)
ates = list(input().split())

for i in range(len(rates)):
    rates[i] = int(rates[i]) // 400

MAX = 0
MIN = 0
j = 0
while j <= 8:
    for k in range(N):
        if j != 8 and j == rates[k]:
            MAX += 1
            MIN += 1
            break
        elif j == 8 and j <= rates[k]:
            MAX += 1
            if MIN == 0:
                MIN = 1
            continue
    j += 1

print(MIN, MAX)


### FIXED CODE ###

N = int(input())
rates = list(input().split())

for i in range(len(rates)):
    rates[i] = int(rates[i]) // 400

MAX = 0
MIN = 0
j = 0
while j <= 8:
    for k in range(N):
        if j != 8 and j == rates[k]:
            MAX += 1
            MIN += 1
            break
        elif j == 8 and j <= rates[k]:
            MAX += 1
            if MIN == 0:
                MIN = 1
                continue
            continue
    j += 1

print(MIN, MAX)
a = input()
b = input()
print(["NO", "YES"][a[0]=b[2] and a[1]=b[1] and a[2]=b[0]])

### FIXED CODE ###

a = input()
b = input()
print(["NO", "YES"][a[0]==b[2] and a[1]==b[1] and a[2]==b[0]])
a,b,c = map(int,input().split())

s = set([a,b,c])

if len(s) = 2:
  print("Yes")
else:
  print("No")


### FIXED CODE ###

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

s = set([a,b,c])

if len(s) == 2:
  print("Yes")
else:
  print("No")
A = input()

ans = 0

ALEN = (len(A))

B = list(A)



B_re =  list(reversed(B))

ans = 0


for i in range(ALEN):
    if B[i] != B_re[i]:
        ans = ans+1
    
if ans　% 2 == 0:
    print(ans//2)
elif ans %2 != 0:
    print((ans//2) +1)
elif ans == 0:
    print(0)

### FIXED CODE ###

N = int(input())
V = list(map(int, input().split()))
C = list(map(int, input().split()))

ans = 0

for i in range(N):
    if ((V[i]) - (C[i])) >= 0:
        ans = ans + ((V[i]) - (C[i]))

print(ans)
# dp[i][t_sum]: i番目までの品物で時間がt_sumを超えないように選んだときの、満足度の総和の最大値
N, T = map(int, input().split())
items = sorted([tuple(map(int, input().split()))
                for i in range(N)], key=lambda x: (x[1], x[0]))


items = sorted([tuple(map(int, input().split()))
                for i in range(N)], key=lambda x: x[0])

if sum([v[0] for v in items[:-1]]) < T:
    print(sum([v[1] for v in items]))
    exit()
items = sorted([tuple(map(int, input().split()))
                for i in range(N)], key=lambda x: (x[1], x[0]))

dp = [[0 for t_sum in range(T+1)] for i in range(N)]

for i in range(N-1):
    for t_sum in range(T):

        # これは配るDP
        if t_sum+items[i][0] < T:
            dp[i+1][t_sum+items[i][0]] = max(dp[i+1][t_sum+items[i][0]],
                                             dp[i][t_sum]+items[i][1])

        # i-1番目の品物を選ばない場合
        dp[i+1][t_sum] = max(dp[i+1][t_sum], dp[i][t_sum])

# print(dp[N-1])

ans = 0
for t in range(T):
    ans = max(ans, dp[N-1][t])
ans += items[-1][1]
print(ans)


### FIXED CODE ###

# dp[i][t_sum]: i番目までの品物で時間がt_sumを超えないように選んだときの、満足度の総和の最大値
N, T = map(int, input().split())
items = [tuple(map(int, input().split())) for i in range(N)]

dp1 = [[0 for t_sum in range(T+1)] for i in range(N+2)]
dp2 = [[0 for t_sum in range(T+1)] for i in range(N+2)]

for i in range(N):
    for t_sum in range(T+1):
        if t_sum-items[i][0] >= 0:
            dp1[i+1][t_sum] = max(dp1[i+1][t_sum], dp1[i]
                                  [t_sum-items[i][0]]+items[i][1])
        dp1[i+1][t_sum] = max(dp1[i+1][t_sum], dp1[i][t_sum])

    for t_sum in range(T+1):
        if t_sum-items[N-1-i][0] >= 0:
            dp2[N-1-i][t_sum] = max(dp2[N-1-i][t_sum], dp2[N-i]
                                    [t_sum-items[N-1-i][0]]+items[N-1-i][1])
        dp2[N-1-i][t_sum] = max(dp2[N-1-i][t_sum], dp2[N-i][t_sum])


ans = 0
for i in range(N):
    for t in range(T):
        ans = max(ans, dp1[i][t]+dp2[i+1][T-1-t]+items[i][1])
print(ans)
import math
import collections

def calc_factors(n):
    i = 2
    f = []
    while i * i <= n:
        if n % i:
            i += 1
        else:
            n //= i
            f.append(i)
    if n > 1:
        f.append(n)
    return f

A, B = map(int, input().split())
print(max(1,len(calc_factors(math.gcd(A,B)))))

### FIXED CODE ###

import fractions

def calc_factors(n):
    a = []
    while n % 2 == 0:
        a.append(2)
        n /= 2
    f = 3
    while f * f <= n:
        if n % f == 0:
            a.append(f)
            n /= f
        else:
            f += 2   
    if n != 1: 
        a.append(n)
    return a

A, B = map(int, input().split())
g = fractions.gcd(A,B)
if g == 1:
    print(1)
else:
    print(len(set(calc_factors(g)))+1)
V=int(input())
 
G=[[] for i in range(V)]
d=[1001001001 for i in range(V)]
used=[False for i in range(V)]
 
import heapq
 
def dijkstra(s):
    q=[]
    d[s]=0
    heapq.heappush(q,(0, s))
     
    while(len(q)):
         
        p=heapq.heappop(q)
        v=p[1]
        used[v]=true
        if d[v]<p[0]:
            continue
        for e in G[v]:
            if (not used[e[0]]) and d[e[0]]>d[v]+e[1]:
                d[e[0]]=d[v]+e[1]
                 
                heapq.heappush(q, (d[e[0]], e[0]))
 
import sys
for l in sys.stdin:
    l=list(map(int,l.split()))
    u=l[0]
    k=l[1]
    G[u]=zip(*[iter(l[2:])]*2)
     
dijkstra(0)
for i, c in enumerate(d):
    print(i, d[i])

### FIXED CODE ###

V=int(input())
 
G=[[] for i in range(V)]
d=[1001001001 for i in range(V)]
used=[False for i in range(V)]
 
import heapq
 
def dijkstra(s):
    q=[]
    d[s]=0
    heapq.heappush(q,(0, s))
     
    while(len(q)):
         
        p=heapq.heappop(q)
        v=p[1]
        used[v]=True
        if d[v]<p[0]:
            continue
        for e in G[v]:
            if (not used[e[0]]) and d[e[0]]>d[v]+e[1]:
                d[e[0]]=d[v]+e[1]
                 
                heapq.heappush(q, (d[e[0]], e[0]))
 
import sys
for l in sys.stdin:
    l=list(map(int,l.split()))
    u=l[0]
    k=l[1]
    G[u]=zip(*[iter(l[2:])]*2)
     
dijkstra(0)
for i, c in enumerate(d):
    print(i, d[i])
n=int(input())
h=list(map(int,input().split()))
ans="Yes"
for i in range(n-1):
    m=min(h[i+1:n])
    if h[i]-m>1:
        ans="No"
        break
print(ans)

### FIXED CODE ###

n=int(input())
t=n
c=1
while t>=10:
    t=t//10
    c=c+1
ans=0
for i in range(1,c):
    if i%2==1:
        ans+=10**(i)-10**(i-1)
if c%2==1:
    ans=ans+n+1-10**(c-1)
print(ans)
# input
n = int(input())

edge = [[] for i in range(n)]
for i in range(n-1):
    a ,b = map(int, list(input().split()))
    edge[a-1].append((b-1, i))

# process
ans = [0 for i in range(n-1)]

def f(pa, c):
    color = 1
    for pb in edge[pa]:
        if color == c: color += 1
        ans[pb[1]] = color 
        f(pb[0], color)
        color += 1

f(0, 0)

# output
print(max(ans))
for i in ans:
    print(i)

### FIXED CODE ###

import sys
sys.setrecursionlimit(10**7)

# input
n = int(input())

edges = [[] for i in range(n)]
for i in range(n-1):
    a ,b = map(int, list(input().split()))
    edges[a-1].append((b-1, i))

# process
ans = [0]*(n-1)

def f(a, c):
    color = 1
    for b, i in edges[a]:
        if color == c: color += 1
        ans[i] = color 
        f(b, color)
        color += 1

f(0, 0)

# output
print(max(ans))
for i in ans:
    print(i)
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

stp = -1 
def main():
    n, k = map(int, readline().split())
    a = [int(i)-1 for i in readline().split()]

    order = []
    ex = set()
    def dfs(node):
        global stp
        order.append(node)
        ex.add(node)
        nx = a[node]
        if nx in ex:
            stp = nx
            return
        dfs(nx)
    dfs(0)
    cnt = order.index(stp)
    m = len(order[cnt:])
    idx = (k-cnt)%m
    print(order[cnt:][idx]+1)
if __name__ == '__main__':
    main()


### FIXED CODE ###

import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
sys.setrecursionlimit(100000000)

stp = -1 
def main():
    n, k = map(int, readline().split())
    a = [int(i)-1 for i in readline().split()]

    order = []
    ex = set()
    def dfs(node):
        global stp
        order.append(node)
        ex.add(node)
        nx = a[node]
        if nx in ex:
            stp = nx
            return
        dfs(nx)
    dfs(0)

    cnt = order.index(stp)
    if k < cnt:
        print(order[k]+1)
    else:    
        m = len(order[cnt:])
        idx = (k-cnt)%m
        print(order[cnt:][idx]+1)
if __name__ == '__main__':
    main()
_ = input()
T = list(map(int, input().split()))
M = int(input())
for i in range(M):
  P, X = map(int, input().split())
  ans = sum(T[:P]+T[P+1])+X
  print(ans)


### FIXED CODE ###

_ = input()
T = list(map(int, input().split()))
M = int(input())
for i in range(M):
  P, X = map(int, input().split())
  ans = sum(T[:P-1])+sum(T[P:])+X
  print(ans)
import numpy as sp
def ABC075D(n, k, xy):
    xy = sp.reshape(sp.array(list(map(int, xy.split()))), (n, 2))
    x = xy[:, 0]
    y = xy[:, 1]
    Min = sp.inf
    for x1 in range(n-1):
        for x2 in range(x1+1, n):
            minx = min(x[x1], x[x2])
            maxx = max(x[x1], x[x2])
            for y1 in range(n-1):
                for y2 in range(y1+1, n):
                    count = 0
                    for i in range(n):
                        if minx <= x[i] <= maxx and min(y[y1], y[y2]) <= y[i] <= max(y[y1], y[y2]):
                            count += 1
                    if count == k:
                        Min = min(Min, abs((x[x1]-x[x2])*(y[y1]-y[y2])))
    print(Min)
n,k=map(int,input().split())
xy=[list(map(int,input().split())) for i in range(n)]
ABC075D(n,k,xy)

### FIXED CODE ###

n,k=map(int,input().split())
x,y=[[0,0] for i in range(n)],[[0,0] for i in range(n)]
xy=[list(map(int,input().split())) for i in range(n)]
for i in range(n):
    x_sub,y_sub=xy[i]
    x[i][0]=x_sub
    x[i][1]=i
    y[i][0]=y_sub
    y[i][1]=i
x.sort()
y.sort()
ans=(10**18)*5
for i1 in range(n):
    for l1 in range(n-i1,1,-1):
        for i2 in range(n):
            for l2 in range(n-i2,1,-1):
                x_sub1=x[i1][0]
                x_sub2=x[i1+l1-1][0]
                y_sub1=y[i2][0]
                y_sub2=y[i2+l2-1][0]
                z=[0]*n
                for i in range(n):
                    if x_sub1<=xy[i][0]<=x_sub2 and y_sub1<=xy[i][1]<=y_sub2:
                        z[i]=1
                if sum(z)>=k:
                    ans=min((x_sub2-x_sub1)*(y_sub2-y_sub1),ans)
                else:
                    break
print(ans)
mod = 10**9+7
rng = 2000100
fctr = [1]+[0]*(rng-1)
finv = [1]+[0]*(rng-1)
for i in range(1,rng):
  fctr[i] = fctr[i-1]*i%mod
for i in range(1,rng):
  finv[i] = pow(fctr[i],mod-2,mod)
def cmb(n,k):
  if n<0 or k<0:
    return 0
  else:
    return fctr[n]*finv[n-k]*finv[k]%mod

x1,y1,x2,y2 = map(int,input().split())
print((cmb(x2+y2+2,x2+1)-cmb(x2+y1+1,y1)-cmb(x1+y2+1,x1)+cmb(x1+y1,x1))%mod)

### FIXED CODE ###

s,t = input().split()
n,m = map(int,input().split())
x = input()
if x == s:
  print(n-1,m)
else:
  print(n,m-1)
from time import time
from math import exp
key = 1
rnd_mod = 12345678901234567891
rnd_x = 9876543210987654321 + 1234567890123456789 * key % rnd_mod
def rnd():
    global rnd_x
    rnd_x = rnd_x**2 % rnd_mod
    return (rnd_x>>10) % (1<<40)
def randrange(a, b=-1):
    if b > 0: return randrange(b-a) + a
    return rnd() % a

def calc():
    s = 0
    last = [-1] * 26
    for i, t in enumerate(A):
        s += S[i][t]
        last[t] = i
        for j, c in enumerate(C):
            s -= c * (i - last[j])
    return s

sTime = time()
test_mode = False

if test_mode:
    D = 365
    C = [randrange(101) for a in range(26)]
    S = [[randrange(20001) for a in range(26)] for _ in range(D)]
    A = [randrange(26) for _ in range(D)]
else:
    D = int(input())
    C = [int(a) for a in input().split()]
    S = [[int(a) for a in input().split()] for _ in range(D)]
    A = [randrange(26) for _ in range(D)]

# A = [0] * D
# A = [0, 16, 12, 13, 12]
# A = [0, 16, 12, 13, 19]
ans = calc()
# print("ans =", ans)
loop = 0
ma = 1500000
while 1:
    loop += 1
    if loop % 100 == 0 and time() - sTime > 1.8:
        break
    T = 3000 * max(1 - loop / 35000, 0.1)
    d = randrange(D)
    i = A[d]
    for k in range(d)[::-1]:
        if A[k] == i:
            prev = k
            break
    else:
        prev = -1
    for k in range(d + 1, D):
        if A[k] == i:
            prev_ne = k
            break
    else:
        prev_ne = D
    for j in range(26):
        t = S[d][j] - S[d][i]
        for k in range(d)[::-1]:
            if A[k] == j:
                new = k
                break
        else:
            new = -1
        for k in range(d + 1, D):
            if A[k] == j:
                new_ne = k
                break
        else:
            new_ne = D
        t += C[j] * (d - new) * (new_ne - d) - C[i] * (d - prev) * (prev_ne - d)
        if (T < 1 and t > 0) or (T >= 1 and randrange(1 << 10) < exp(max(min(t / T, 0), -10)) * (1 << 10)):
            A[d] = j
            ans += t
            prev, prev_ne = new, new_ne
            i = j
            if ans > ma:
                ma = ans
                maA = A[:]
            if 0:
                print("A =", A)
                print("ans =", ans)
                print("calc =", calc())
            
A = maA
ans = ma
if test_mode:
    print(ans)
    print("A =", A)
    print("loop =", loop)
else:
    print(*[a + 1 for a in A], sep = "\n")


### FIXED CODE ###

D = int(input())
for _ in range(D):
    print(1)
K,S = map(int,input().split())
count = 0
for i in range(K+1):
    for j in range(K+1):
        for k in range(K+1):
            if i+j+k == S:
                count += 1
print(count)


### FIXED CODE ###

S = str(input())
print(S[:5]+" "+S[6:13]+" "+S[14:])
s=input()
t=input()
c=[0 for i in range(len(s)-len(t))]
for i in range(len(s)-len(t)):
    for j in range(len(t)):
        if s[i+j]!=t[j]:
            c[i]=c[i]+1

print(min(c))

### FIXED CODE ###

s=input()
t=input()
if len(s)==len(t):
    cm=0
    for i in range(len(s)):
        if s[i]!=t[i]:
            cm+=1
else:
    cm=1000
    for i in range(len(s)-len(t)):
        cn=0
        for j in range(len(t)):
            if s[i+j]!=t[j]:
                cn+=1
        cm=min(cm,cn)

print(cm)
N, T = map(int, input().split())
for i in range(N):
  c, t = map(int, input().split())
  if t<=T:
    x=min(c, 1001)
print('TLE' if x=1001 else c)

### FIXED CODE ###

N, T = map(int, input().split())

cost = float("inf")
for i in range(N):
    c, t = map(int, input().split())
    if t <= T:
        cost = min(cost, c) 

print("TLE" if cost == float("inf") else cost)
def getCal(a,b):
    return a//b, a%b, float((a*100000/b)/100000)

a, b = map(int, input().split())
d, r, f = getCal(a,b)

print("{} {} {2: 5f}".format(d, r, f))

### FIXED CODE ###

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

print(a//b, a%b, '%.5f' % (a/b))
from bisect import bisect_left,bisect

N=int(input())
a=list(map(int,input.split()))
b=list(map(int,input.split()))
ans=0
for i in range(29):
  a_nex=sorted(list(map(lambda x:x%2**(i+1),a)))
  b_nex=sorted(list(map(lambda x:x%2**(i+1),b)))
  l=0
  p=q=r=0
  for k in reversed(a_nex):
    while p<N and b_nex[p]<2**i-k:
      p+=1
    while q<N and b_nex[q]<2*2**i-k:
      q+=1
    while r<N and b_nex[r]<3*2**i-k:
      r+=1
    l+=q-p+N-r
  ans+=l%2<<i
print(ans)   
  


### FIXED CODE ###

N=int(input())
a=list(map(int,input().split()))
b=list(map(int,input().split()))
ans=0
def f(i):
  res=0
  t=2**i
  a_nex=sorted([p%(2*t) for p in a])
  b_nex=sorted([p%(2*t) for p in b])
  l=0
  p=q=r=0
  for k in reversed(a_nex):
    while p<N and k+b_nex[p]<t:
      p+=1
    while q<N and k+b_nex[q]<2*t:
      q+=1
    while r<N and k+b_nex[r]<3*t:
      r+=1
    l+=q-p+N-r
  res=(l%2)<<i
  return res
for k in range(29):
  ans+=f(k)
print(ans)
N = int(input())
L = list(map(int,input().split())
 
L.sort()
 
s = 0
 
for n in range(N):
    s += L[2*n]
print(s)

### FIXED CODE ###

n = int(input())
list_L = list(map(int, input().split()))
list_L.sort()
sum = 0
for i in range(n):
    sum += list_L[2*i]
print(sum)
import sys

input = sys.stdin.readline

sys.setrecursionlimit(5*10**5)

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

seen = [False]*N
stop = []

def dfs(v):
    for nv in edge[v]:
        if not seen[nv]:
            seen[nv]=True
            dfs(nv)
    stop.append(v)

for i in range(N):
    if not seen[i]:
        seen[i] = True
        dfs(i)

seen = [False]*N

def scc():
    res = []
    connect = []
    def rev_dfs(v):
        for nv in rev_edge[v]:
            if not seen[nv]:
                connect.append(nv)
                seen[nv]=True
                rev_dfs(nv)

    while stop:
        while stop and seen[stop[-1]]:
            stop.pop()
        if not stop:
            break
        connect = [stop[-1]]
        seen[stop[-1]] = True
        rev_dfs(stop[-1])
        res.append(connect)
    return res

res = scc()
print(len(res))
for L in res:
    print(len(L),*L)


### FIXED CODE ###

import sys

input = sys.stdin.readline

sys.setrecursionlimit(5*10**5)

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

seen = [False]*N
stop = []

def dfs(v):
    for nv in edge[v]:
        if not seen[nv]:
            seen[nv]=True
            dfs(nv)
    stop.append(v)

for i in range(N):
    if not seen[i]:
        seen[i] = True
        dfs(i)

seen = [False]*N

def scc():
    res = []
    connect = []
    def rev_dfs(v):
        for nv in rev_edge[v]:
            if not seen[nv]:
                connect.append(nv)
                seen[nv]=True
                rev_dfs(nv)

    while stop:
        while stop and seen[stop[-1]]:
            stop.pop()
        if not stop:
            break
        connect = [stop[-1]]
        seen[stop[-1]] = True
        rev_dfs(stop[-1])
        res.append(connect)
    return res

res = scc()
print(len(res))
for L in res:
    print(len(L),*L)
import sys
A, B, C, D, E, F = map(int, input().split())


def concentration(water, suger):
    if water * E/100 < suger or water + suger == 0:
        return 0
    return (100 * suger/(water + suger))

lst_w = []
limit_w = (F+A*100-1)//(A*100)
for i in range(limit_w):
    for j in range(limit_w):
        if 100 * (A * i + B * j) <= F:
            lst_w += [100 * (A * i + B * j)]

lst_s = []
limit_s = (F+C-1)//C
for i in range(limit_s):
    for j in range(limit_s):
        if C* i + D * j <= F:
            lst_s += [C * i + D * j]

# print (lst_w)
# print (lst_s)
set_w = set(lst_w)
set_s = set(lst_s)

# print (set_w)
# print (set_s)

ans = 0
ans_total = 0
ans_suger = 0
for water in set_w:
    for suger in set_s:
        if water + suger <= F:
            a = concentration(water, suger)
            if ans < a:
                ans = a
                ans_total = water + suger
                ans_suger = suger
            if ans == 50:
                print (ans_total, ans_suger)
                sys.exit()

if ans = 0:
    print (set_w[1], 0)
else:
    print (ans_total, ans_suger)

# print (ans)


### FIXED CODE ###

N = int(input())
A = int(input())
print (N * N -A)