Harryxun/stf_run huggingface dataset:
a = input()
x = int(a)

for i, k in x:
  if k == 0:
    print(i)
    break;

### FIXED CODE ###

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

if a[0] == 0:
  print(1)
elif a[1] == 0:
  print(2)
elif a[2] == 0:
  print(3)
elif a[3] == 0:
  print(4)
else:
  print(5)
A, B = map( int, input().split())
C = []

C1 = A + B
C.append(C1)

C2 = A - B
C.append(C2)

C3 = A * B
C.apend(C3)

C = sorted(C)

print(C[2])



### FIXED CODE ###

A, B = map( int, input().split())
C = []

C1 = A + B
C.append(C1)

C2 = A - B
C.append(C2)

C3 = A * B
C.append(C3)

C = sorted(C)

print(C[2])
def a_darker_and_darker(H, W, Grid, INF=float('inf')):
    from collections import deque

    def is_in_field(row, col):
        return (0 <= row < W) and (0 <= col < H)

    q = deque()
    for row in range(H):
        for col in range(W):
            if Grid[row][col] == '#':
                q.append((row, col, 0))

    grid = [[float('inf')] * W for _ in range(H)]
    directions = ((-1, 0), (0, 1), (1, 0), (0, -1))  # 上右下左の隣接マスを指定
    while q:
        row, col, move = q.pop()
        grid[row][col] = min(grid[row][col], move)

        for dr, dc in directions:
            nr, nc = row + dr, col + dc
            if is_in_field(nr, nc) and grid[nr][nc] == INF:
                q.appendleft((nr, nc, move + 1))
    return max([max(row) for row in grid])

H, W = [int(i) for i in input().split()]
Grid = [input() for _ in range(H)]
print(a_darker_and_darker(H, W, Grid))

### FIXED CODE ###

def a_darker_and_darker(H, W, Grid):
    def is_in_field(row, col):
        return (0 <= row < H) and (0 <= col < W)

    grid, q = [[None] * W for _ in range(H)], []
    # 黒マスがどこにあるかを調べる。ついでにgridを初期化
    for row in range(H):
        for col in range(W):
            if Grid[row][col] == '#':
                grid[row][col] = True
                q.append((row, col))
            else:
                grid[row][col] = False

    # '#'があるマスから上下左右に移動することを繰り返して任意のマスに到達する。
    # 何回繰り返せばすべてのマスに到達できるか？
    directions = ((-1, 0), (0, 1), (1, 0), (0, -1))  # 上右下左の隣接マスを指定
    ans = 0
    while q:
        tmp = []
        for row, col in q:
            for dr, dc in directions:
                nr, nc = row + dr, col + dc
                if is_in_field(nr, nc) and (not grid[nr][nc]):
                    grid[nr][nc] = True
                    tmp.append((nr, nc))
        ans += (1 if tmp else 0)
        q = tmp
    return ans

H, W = [int(i) for i in input().split()]
Grid = [input() for _ in range(H)]
print(a_darker_and_darker(H, W, Grid))
def main():
    ABC = [int(s) for s in input().split()]
    sorted = ABC.sort()
    result = int(str(sorted[0])+str(sorted[1])) + sorted[2]
    print(result)

if __name__ == "__main__":
    main()

### FIXED CODE ###

def main():
    inputs = [int(s) for s in input().split()]
    sorted_list = sorted(inputs,reverse=True)
    result = int(str(sorted_list[0])+str(sorted_list[1])) + sorted_list[2]
    print(result)

if __name__ == "__main__":
    main()
a, b, n = map(int, input().split())
c = [0]*(n+1)
for x in range(n+1):
  c[x] = (a*x)//b - a*(x//b)
print(max(c))
  

### FIXED CODE ###

a, b, n = map(int, input().split())
x = min(b-1,n)
print((a*x)//b - a*(x//b))
def resolve():
    import sys
    input = sys.stdin.readline
    # 整数 1 つ
    n = int(input())
    # 整数複数個
    # a, b = map(int, input().split())
    # 整数 N 個 (改行区切り)
    # N = [int(input()) for i in range(N)]
    # 整数 N 個 (スペース区切り)
    # N = list(map(int, input().split()))
    # 整数 (縦 H 横 W の行列)
    A = [list(map(int, input().split())) for i in range(n)]

    Happy = [0, 0, 0] * (n+1)
    for i in range(1, n+1):
        for j in range(3):
            for k in range(3):
                if j != k:
                    Happy[i][j] = max(Happy[i][j], Happy[i-1][k] + A[i-1][j])

    print("n")


resolve()

### FIXED CODE ###

def resolve():
    import sys
    input = sys.stdin.readline
    # 整数 1 つ
    n = int(input())
    # 整数複数個
    # a, b = map(int, input().split())
    # 整数 N 個 (改行区切り)
    # N = [int(input()) for i in range(N)]
    # 整数 N 個 (スペース区切り)
    # N = list(map(int, input().split()))
    # 整数 (縦 H 横 W の行列)
    A = [list(map(int, input().split())) for i in range(n)]

    Happy = [[0, 0, 0] for _ in range(n+1)]
    for i in range(1, n+1):
        for j in range(3):
            for k in range(3):
                if j != k:
                    Happy[i][j] = max(Happy[i][j], Happy[i-1][k] + A[i-1][j])

    print(max(Happy[n]))
resolve()
a=int(input())
print(a.replace(1,9).replace(9,1))


### FIXED CODE ###

a=int(input())
b=str(a).replace('1','a').replace('9','b')
c=b.replace('a','9').replace('b','1')
print(int(c))
A,B,X=map(int,input().split())
print((X - A) % B)

### FIXED CODE ###

x=int(input())
a=int(input())
b=int(input())
print((x-a)%b)
S = input()
diff = 1000
for i in range(len(S)-2):
    S_int = int(S[i:i+3])
    diff = min(diff, abs(753-S_int)
print(diff)


### FIXED CODE ###

S = input()
diff = 1000
for i in range(len(S)-2):
    S_int = int(S[i:i+3])
    diff = min(diff, abs(753-S_int))
print(diff)
a,b,c=(int(x) for x in input().split())
 
print(str(c)+" "+str(a)+" " + str(b) " ")

### FIXED CODE ###

a,b,c=input().split()
 
print(str(c)+" "+str(a)+" " + str(b) + " ")
S = input()
 
MOD = 10 ** 9 + 7
N = 13
 
DP = [0] * N
 
# 初期値
DP[0] = 1
digit = 1
 
# 0 -> 5 -> ?5 -> ??5 -> ...に対する余りがどこになるかを更新していく
for i in range(len(S) - 1, -1, -1):
    nextDP = [0] * N
 
    if S[i] == "?":
        for k in range(10):
            for j in range(N):
                nextDP[(k * digit + j) % N] += DP[j]
                nextDP[(k * digit + j) % N] %= MOD
    else:
        k = int(S[i])
        for j in range(N):
            nextDP[(k * digit + j) % N] += DP[j]
            nextDP[(k * digit + j) % N] %= MOD
 
    digit *= 10
    digit %= N
    DP = nextDP[:]
 
print(DP[5])
 
 
 
S = input()

MOD = 10 ** 9 + 7
N = 13

DP = [0] * N

# 初期値
DP[0] = 1
digit = 1

# 0 -> 5 -> ?5 -> ??5 -> ...に対する余りがどこになるかを更新していく
for i in range(len(S) - 1, -1, -1):
    nextDP = [0] * N

    if S[i] == "?":
        for k in range(10):
            for j in range(N):
                nextDP[(k * digit + j) % N] += DP[j]
                nextDP[(k * digit + j) % N] %= MOD
    else:
        k = int(S[i])
        for j in range(N):
            nextDP[(k * digit + j) % N] += DP[j]
            nextDP[(k * digit + j) % N] %= MOD

    digit *= 10
    digit %= N
    DP = nextDP[:]

print(DP[5])

### FIXED CODE ###

S = input()
 
MOD = 10 ** 9 + 7
N = 13
 
DP = [0] * N
 
# 初期値
DP[0] = 1
digit = 1
 
# 0 -> 5 -> ?5 -> ??5 -> ...に対する余りがどこになるかを更新していく
for i in range(len(S) - 1, -1, -1):
    nextDP = [0] * N
 
    if S[i] == "?":
        for k in range(10):
            for j in range(N):
                nextDP[(k * digit + j) % N] += DP[j]
                nextDP[(k * digit + j) % N] %= MOD
    else:
        k = int(S[i])
        for j in range(N):
            nextDP[(k * digit + j) % N] += DP[j]
            nextDP[(k * digit + j) % N] %= MOD
 
    digit *= 10
    digit %= N
    DP = nextDP[:]
 
print(DP[5])
 
"""
??2??5

"""
n = int(input())
s = input()
a = s.count("R")
b = s.count("G")
c = s.count("B")
z = a*b*c
if z ==0:
  print(0)
else:
  x = 0
  for i in range(n-2):
    for j in range(i+1, n-1):
      if s[i]==s[j]:
        continue
      else:
        if 2*j-i<= n-1 and len({s[i], s[j], s[2*j-i]})==3:
          x += 1
print(z-x)


### FIXED CODE ###

n = int(input())
s = input()
a = s.count("R")
b = s.count("G")
c = s.count("B")
z = a*b*c
R=[]
G=[]
B=[]
for i in range(n):
  if s[i]=="R":
    R.append(i)
  elif s[i]=="G":
    G.append(i)
  else:
    B.append(i)
x = 0
for i in R:
  for j in G:
    if 0 <= 2*j-i <= n-1 and s[2*j-i]=="B":
      x+=1
    if 0 <= 2*i-j <= n-1 and s[2*i-j]=="B":
      x+=1
    if (i+j)%2==0 and s[(i+j)//2]=="B":
      x+=1
print(z-x)
n = list(map(int, input().split()))
print(max(n) * 10 + sum(n.remove(nmax)))

### FIXED CODE ###

import itertools, copy

n = input().split()

ans = 0
for p0, p1 in itertools.permutations(n, 2):
    n_ = copy.copy(n)
    n_.remove(p0)
    n_.remove(p1)
    
    total = int(''.join([p0, p1])) + int(n_[0])
    ans = max(ans, total)

print(ans)
import sys
import os


def main():
    if os.getenv("LOCAL"):
        sys.stdin = open("input.txt", "r")

        a = int(sys.stdin.readline().rstrip())
        n, mod = divmod(a, 2)
    print(n if mod == 0 else n + 1)


if __name__ == '__main__':
    main()


### FIXED CODE ###

a = input()
n, mod = divmod(int(a), 2)
print(n if mod == 0 else n + 1)
a = input()
b = a - a // 10 * 10
c = ("pon" if b == 0 else
     "pon" if b == 1 else
     "hon" if b == 2 else
     "bon" if b == 3 else
     "hon" if b == 4 else
     "hon" if b == 5 else
     "pon" if b == 6 else
     "hon" if b == 7 else
     "pon" if b == 8 else
     "hon" if b == 9 else
     ""
     )
print(c)

### FIXED CODE ###

a = int(input())
b = a - a // 10 * 10
c = ("pon" if b == 0 else
     "pon" if b == 1 else
     "hon" if b == 2 else
     "bon" if b == 3 else
     "hon" if b == 4 else
     "hon" if b == 5 else
     "pon" if b == 6 else
     "hon" if b == 7 else
     "pon" if b == 8 else
     "hon" if b == 9 else
     ""
     )
print(c)
m = int(input())
d = [0] * m
c = [0] * m
for i in range(m):
    d[i], c[i] = map(int, input().split())

print((sum(c)-1+sum([c[i]*d[i] for i in range(m)]-1)//9) % 1000000007)

### FIXED CODE ###

m = int(input())
d = [0] * m
c = [0] * m
for i in range(m):
    d[i], c[i] = map(int, input().split())

print(sum(c)-1+(sum([c[i]*d[i] for i in range(m)])-1)//9)
S = int(input())
K = input()

if len(S) < K:
    print(S)
else:
    print(S[:K]+'...')

### FIXED CODE ###

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

if len(S) <= K:
    print(S)
else:
    print(S[:K]+'...')
#python3
n,x=map(int, input().split())
l=[int(i) for i in input().split()]
cnt=0
d=0
while d<=x:
  d=d+l[cnt]
  cnt+=1
print(cnt)

### FIXED CODE ###

#python3
n,x=map(int, input().split())
l=[int(i) for i in input().split()]
d=0
c=1
for i in range(n):
  d=d+l[i]
  if d<=x:
    c+=1
print(c)
import math,string,itertools,fractions,heapq,collections,re,array,bisect,sys,random,time,copy,functools

sys.setrecursionlimit(10**7)
inf = 10**20
mod = 10**9 + 7

def LI(): return [int(x) for x in sys.stdin.readline().split()]
def LI_(): return [int(x)-1 for x in sys.stdin.readline().split()]
def LF(): return [float(x) for x in sys.stdin.readline().split()]
def LS(): return sys.stdin.readline().split()
def I(): return int(sys.stdin.readline())
def F(): return float(sys.stdin.readline())
def S(): return input()


def main():
    n = I()
    d = collections.defaultdict(set)
    kk = None
    for _ in range(n-1):
        a,b = LI()
        kk = [a,b]
        d[a].add(b)
        d[b].add(a)

    if sum(kk) > 10**5*1.5:
        raise 't'


    tt = True
    gf = collections.defaultdict(bool)
    while tt:
        tt = False
        for k,v in list(d.items()):
            if len(v) == 1:
                vt = list(v)[0]
                if len(d[vt]) == 1:
                    continue
                for vv in d[vt]:
                    if vv == k:
                        continue
                    if vt in d[vv]:
                        d[vv].remove(vt)
                d[vt] = set([k])
                tt = True
            elif len(v) == 0:
                return 'First'
    return 'Second'


print(main())


### FIXED CODE ###

import math,string,itertools,fractions,heapq,collections,re,array,bisect,sys,random,time,copy,functools

sys.setrecursionlimit(10**7)
inf = 10**20
mod = 10**9 + 7

def LI(): return [int(x) for x in sys.stdin.readline().split()]
def LI_(): return [int(x)-1 for x in sys.stdin.readline().split()]
def LF(): return [float(x) for x in sys.stdin.readline().split()]
def LS(): return sys.stdin.readline().split()
def I(): return int(sys.stdin.readline())
def F(): return float(sys.stdin.readline())
def S(): return input()


def main():
    n = I()
    d = collections.defaultdict(set)
    kk = None
    for _ in range(n-1):
        a,b = LI()
        kk = [a,b]
        d[a].add(b)
        d[b].add(a)

    tt = True
    gf = collections.defaultdict(bool)
    while tt:
        tt = False
        for k,v in list(d.items()):
            if len(v) == 1:
                vt = list(v)[0]
                if len(d[vt]) == 1:
                    continue
                for vv in d[vt]:
                    if vv == k:
                        continue
                    if vt in d[vv]:
                        d[vv].remove(vt)
                d[vt] = set([k])
                tt = True
            elif len(v) == 0:
                return 'First'
    return 'Second'


print(main())
s = input()
a = s[::2].count('0') + s[1::2].count('1')
b = s[::2].count('1') + s[1::2].count('0')
print(min(a, b))

### FIXED CODE ###

s = str(raw_input())
a = s[::2].count('0') + s[1::2].count('1')
b = s[::2].count('1') + s[1::2].count('0')
print(min(a, b))
import sys

readline = sys.stdin.readline

H, W = map(int, readline().split())
S = [readline().rstrip() for i in range(H)]

vert = [[0]*W for i in range(W)]
hori = [[0]*W for i in range(H)]

for y in range(H):
    for x in range(W):

        if x > 0 and S[y][x - 1] != '#':
            hori[y][x] = hori[y][x - 1]
        elif S[y][x] == '#':
            hori[y][x] = 0
        else:
            # hori
            count = 1
            while x + count < W and S[y][x + count] == '.':
                count += 1
            hori[y][x] = count

        if y > 0 and S[y - 1][x] != '#':
            vert[y][x] = vert[y - 1][x]
        elif S[y][x] == '#':
            vert[y][x] = 0
        else:
            # hori
            count = 1
            while y + count < H and S[y + count][x] == '.':
                count += 1
            vert[y][x] = count

ans = 0
for y in range(H):
    for x in range(W):
        a = hori[y][x] + vert[y][x] - 1
        ans = max(a, ans)

print(ans)

### FIXED CODE ###

import sys

readline = sys.stdin.readline

H, W = map(int, readline().split())
S = [readline().rstrip() for i in range(H)]

vert = [[0]*W for i in range(H)]
hori = [[0]*W for i in range(H)]

for y in range(H):
    for x in range(W):

        if x > 0 and S[y][x - 1] != '#':
            hori[y][x] = hori[y][x - 1]
        elif S[y][x] == '#':
            hori[y][x] = 0
        else:
            # hori
            count = 1
            while x + count < W and S[y][x + count] == '.':
                count += 1
            hori[y][x] = count

        if y > 0 and S[y - 1][x] != '#':
            vert[y][x] = vert[y - 1][x]
        elif S[y][x] == '#':
            vert[y][x] = 0
        else:
            # hori
            count = 1
            while y + count < H and S[y + count][x] == '.':
                count += 1
            vert[y][x] = count

ans = 0
for y in range(H):
    for x in range(W):
        a = hori[y][x] + vert[y][x] - 1
        ans = max(a, ans)

print(ans)
def gcd(a, b):
	if a == 0:
		return b
	return gcd(b % a, a)
n = int(input())
res = int(input())
while n > 1:
	x = int(input())
	res = (res * x) / gcd(res, x);
	n -= 1
print(res)

### FIXED CODE ###


def computeGCD(x, y): 
   while(y):
   		x, y = y, x % y
   return x 
n=int(raw_input())
ar=[]
for i in range(0,n):
	k=int(raw_input())
	ar.append(k)

an=ar[0]
for x in range(1,n):
	an=(an*ar[x])/computeGCD(an,ar[x]);
print(an)
a,b = map(int, imput().split())
 
if abs(a+b)%2 ==0:
    print(abs(a+b)//2)
else:
    print('IMPOSSIBLE')

### FIXED CODE ###

a, b = map(int, input().split())
if abs(b+a) % 2 == 0:
    print(abs(a+b)//2)
else:
    print('IMPOSSIBLE')
N = input()
L = [int(input()) for i in range(N)]
print("Yes" if sum(L) > 2*max(L) else "No")

### FIXED CODE ###

input()
L = list(map(int, input().split()))
print("Yes" if sum(L) > 2*max(L) else "No")
N=int(input())
A=list(map(int,input().split()))
ans=0
for i,j in enumerate(A):
    if j%2!=0:
        print(ans)
        exit()
    else:
        A[i]=j/2
    count+=1

### FIXED CODE ###

sss=list(input())
print(sss.count('1'))
a, b = raw_input().split(" ")
print int(a) * int(b) + " " + (int(a) + int(b)) * 2

### FIXED CODE ###

a, b = raw_input().split(" ")
print str(int(a) * int(b)) + " " + str((int(a) + int(b)) * 2)
S = input()
print("HEISEI" if(S <= 2019/4/30) else "TBD")

### FIXED CODE ###

_,m,_ = map(int,input().split("/"))
print("TBD" if m > 4 else "Heisei")
N = int(input())
A = list(map(int, input().split()))
c=0
while True:
    for i in range(N):
        if A[i] % 2 !=0:
            print(c)
            exit()
        else:
            A[i] = A[i] / 2
    c=c+1

### FIXED CODE ###

S = list(input())
print(S.count("1"))
N,K,X,Y=map(int,input().split(sep))
if N>K:
    print((K*X)+((N-K)*Y))
else:
    print((N*X))

### FIXED CODE ###

N=int(input())
K=int(input())
X=int(input())
Y=int(input())
if N>K:
    print(K*X+(N-K)*Y)
else:
    print(N*X)
180*N-360

### FIXED CODE ###

N=int(input())
print(180*N-360)
n, k, *h = map(int,open(0).read().split())
print(sum(h>=k for h_i in h))

### FIXED CODE ###

# -*- coding: utf-8 -*-
n, k = map(int, input().split())
list = list(map(int, input().split()))
ans = 0
for n_i in range(0, n):
    if list[n_i] >= k:
        ans += 1
print(ans)
s = input()
a = list("abcdefghijklmnopqrstuvwxyz")
if len(s) != 26:
    nokori = set(a) - set(s)
    nokori = sorted(nokori, key=a.index)
    print(s + nokori[0])
else:
    for i in range(2, 27):
        if s[-i] <= s[1 - i]:
            break
    for k in range(1, 27):
        if s[-k] > s[-k - 1]:
            break
    #print(i, k)
    if i == 26:
        print(-1)
    else:
        s_ = sorted(s[-i + 1:])
        for j in s_:
            if j > s[-i]:
                break
        #print(s[:-i] + j)

        T = sorted(s[-k:])
        for t in T:
            if t > s[-k - 1]:
                break
        print(s[:-k - 1] + t)
        #print(s_, T)

### FIXED CODE ###

s = input()
a = list("abcdefghijklmnopqrstuvwxyz")
if s == "zyxwvutsrqponmlkjihgfedcba":
     print(-1)
elif len(s) != 26:
    nokori = set(a) - set(s)
    nokori = sorted(nokori, key=a.index)
    print(s + nokori[0])
else:
    for i in range(1, 27):
        if list(s)[-i] > list(s)[-(i + 1)]:
            break
    T = sorted(list(s)[-i:])
    #print(T)
    for t in T:
        if t > list(s)[-(i + 1)]:
            break
    print("".join(list(s)[:-(i + 1)]) + t)
n = int(input())
A = list(map(int, input().split()))
count = 0
while True:
    for i in range(n):
        if (A[i] % 2 == 1) or (A[i] == 0):
            break
        elif:
            A[i] = A[i] // 2
            s += 1
            continue
    
    break
print(count)


### FIXED CODE ###

n = int(input())
A = list(map(int, input().split()))
s = 0

def count(A, n):
    for i in range(n):
        if (A[i] % 2 == 1) or (A[i] == 0):
            return False
        A[i] = A[i] // 2
    return True

while True:
    if count(A, n):
        s += 1
    else:
        break
    
print(s)
from math import sqrt

def cross(P0, P1, P2):
    x0, y0 = P0; x1, y1 = P1; x2, y2 = P2
    x1 -= x0; x2 -= x0
    y1 -= y0; y2 -= y0
    return x1*y2 - x2*y1

def dot(P0, P1, P2):
    x0, y0 = P0; x1, y1 = P1; x2, y2 = P2
    x1 -= x0; x2 -= x0
    y1 -= y0; y2 -= y0
    return x1*x2 + y1*y2

def dist2(P0, P1):
    x0, y0 = P0; x1, y1 = P1
    return (x1 - x0)**2 + (y1 - y0)**2

def convex_hull(PS):
    QS = []
    n = len(PS)
    if n==1:
        return PS[:]
    for P in PS:
        while len(QS)>1 and cross(QS[-1], QS[-2], P) > 0:
            QS.pop()
        QS.append(P)
    k = len(QS)
    RS = reversed(PS); next(RS)
    for P in RS:
        while len(QS)>k and cross(QS[-1], QS[-2], P) > 0:
            QS.pop()
        QS.append(P)
    return QS

def cross4(S0, S1, T0, T1):
    x0, y0 = S0; x1, y1 = S1
    X0, Y0 = T0; X1, Y1 = T1
    return (x1-x0)*(Y1-Y0) - (y1-y0)*(X1-X0)
def calipers(PS):
    QS = convex_hull(PS)
    n = len(QS)
    if n == 2:
        return sqrt(dist2(*QS))
    i = j = 0
    for k in range(n):
        if QS[k] < QS[i]: i = k
        if QS[j] < QS[k]: j = k
    res = 0
    si = i; sj = j
    while i != sj or j != si:
        res = max(res, dist2(QS[i], QS[j]))
        if cross4(QS[i], QS[i-n+1], QS[j], QS[j-n+1]) < 0:
            i = (i + 1) % n
        else:
            j = (j + 1) % n
    return sqrt(res)

n = int(input())
PS = [[*map(float, input().split())] for i in range(n)]
PS.sort()
print("%.09f" % calipers(PS))

### FIXED CODE ###

from math import sqrt

def cross(P0, P1, P2):
    x0, y0 = P0; x1, y1 = P1; x2, y2 = P2
    x1 -= x0; x2 -= x0
    y1 -= y0; y2 -= y0
    return x1*y2 - x2*y1

def dot(P0, P1, P2):
    x0, y0 = P0; x1, y1 = P1; x2, y2 = P2
    x1 -= x0; x2 -= x0
    y1 -= y0; y2 -= y0
    return x1*x2 + y1*y2

def dist2(P0, P1):
    x0, y0 = P0; x1, y1 = P1
    return (x1 - x0)**2 + (y1 - y0)**2

def convex_hull(PS):
    QS = []
    n = len(PS)
    if n==1:
        return PS[:]
    for P in PS:
        while len(QS)>1 and cross(QS[-1], QS[-2], P) > 0:
            QS.pop()
        QS.append(P)
    k = len(QS)
    RS = reversed(PS); next(RS)
    for P in RS:
        while len(QS)>k and cross(QS[-1], QS[-2], P) > 0:
            QS.pop()
        QS.append(P)
    return QS

def cross4(S0, S1, T0, T1):
    x0, y0 = S0; x1, y1 = S1
    X0, Y0 = T0; X1, Y1 = T1
    return (x1-x0)*(Y1-Y0) - (y1-y0)*(X1-X0)
def calipers(PS):
    QS = convex_hull(PS)
    n = len(QS)
    if n == 2:
        return sqrt(dist2(*QS))
    i = j = 0
    for k in range(n):
        if QS[k] < QS[i]: i = k
        if QS[j] < QS[k]: j = k
    res = 0
    si = i; sj = j
    while i != sj or j != si:
        res = max(res, dist2(QS[i], QS[j]))
        if cross4(QS[i], QS[i-n+1], QS[j], QS[j-n+1]) < 0:
            i = (i + 1) % n
        else:
            j = (j + 1) % n
    return sqrt(res)

n = input()
PS = [map(float, raw_input().split()) for i in range(n)]
PS.sort()
print("%.09f" % calipers(PS))
# D - Banned K

N = int(input())
A = [int(a) for a in input().split()]

def f(i, ls, chosen):
    n1 = len(ls)
    n2 = len(chosen)
    if n1 <= i or n2 == 2:
        if n2 == 2 and chosen[0] == chosen[1]:
            return 1
        return 0
    return f(i + 1, ls, chosen) + f(i + 1, ls, chosen + [ls[i]])

for i in range(N):
    print(f(0, A[:i] + A[i + 1:], []))


### FIXED CODE ###

N = int(input())
A = [int(a) for a in input().split()]
cnt = {}
total = 0

for a in A:
    if a not in cnt:
        cnt[a] = 0
    cnt[a] += 1

for i in cnt.values():
    total += i * (i - 1) // 2

for a in A:
    print(total - (cnt[a] - 1))
S = input()
K = int(input())

answer = S[1]
print(answer)


### FIXED CODE ###

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

are_all_one = True
for i in range(len(S)):
    if S[i] != '1':
        are_all_one = False
        break

nth = i + 1
if are_all_one or K < nth:
    print(1)
    exit()

answer = S[i]
print(answer)
n = int(input())
a = list(map(int, input().split()))

# S = sorted(A)
# MAXS = max(A)
# two = S[-2]
# print("MAX {} two {}".format(MAXS,two))
# count = S.count(max(S))
#
# for i in range(N):
#     if A[i] == MAXS:
#         if count > 1:
#             print(MAXS)
#         else:
#             print(two)
#     else:
#         print(MAXS)

#


c = a.index(max(a))
m = max(a)
a.sort()
d = a[-2]
for i in range(n):
    if i == c:
        print(d)
    else:
        print(m)




# S = sorted(A)
# MAXS = max(A)
#
# for i in range(N):
#     if A[i] == MAXS:
#         print(S[-2])
#     else:
#         print(S[-1])


# #
# for i in range(N):
#
#     if i == 0:
#         print(max(A[1:]))
#
#     elif i == N-1:
#         print(max(A[:i]))
#
#     else:
#         low = max(A[0:i])
#         high = max(A[i+1:])
#
#         if high > low:
#             print(high)
#         else:
#             print(low)


### FIXED CODE ###

# N = int(input())
# A = list(map(int, input().split()))
# 
# S = sorted(A)
# MAXS = max(A)
# 
# for i in range(N):
#     if A[i] == MAXS:
#         print(S[-2])
#     else:
#         print(S[-1])
# 


n = int(input())
a = list()
for i in range(n):
    a.append(int(input()))
c = a.index(max(a))
m = max(a)
a.sort()
d = a[-2]
for i in range(n):
    if i == c:
        print(d)
    else:
        print(m)