Buggy python submission (verdict: Runtime Error):
##C
n=input().int
a=list(int(input()) for i in range(n))
b=sorted(a)

for i in range(n):
    if a[i]==b[-1]:
        print(b[-2])
    else:
        print(b[-1])

Fixed submission:
##C
n=int(input())
a=list(int(input()) for i in range(n))
b=sorted(a)

for i in range(n):
    if a[i]==b[-1]:
        print(b[-2])
    else:
        print(b[-1])

Buggy python submission (verdict: Runtime Error):
##C
n=input().int
a=list(int(input()) for i in range(n))
b=sorted(a,reverse=True)

for i in range(n):
    if a[i]==b[-1]:
        print(b[-2])
    else:
        print(b[-1])

Fixed submission:
##C
n=int(input())
a=list(int(input()) for i in range(n))
b=sorted(a)

for i in range(n):
    if a[i]==b[-1]:
        print(b[-2])
    else:
        print(b[-1])

Buggy python submission (verdict: Runtime Error):
n=int(input())
a=list(int(input()) for i in range(n))
x=max(a)
b=a.remove(x)
c=max(b)
if a.count(max(a))==1:
  for y in range(n):
  	if a[y]==max(a):
  		
  		print(c)
  	else:
  		print(max(a))
else:
  for i in range(n):
    print(max(a))



Fixed submission:
##C
n=int(input())
a=list(int(input()) for i in range(n))
b=sorted(a)

for i in range(n):
    if a[i]==b[-1]:
        print(b[-2])
    else:
        print(b[-1])

Buggy python submission (verdict: Runtime Error):
n=int(input())
a=list(int(input()) for i in range(n))
b=a.remove(max(a))
c=max(b)
if a.count(max(a))==1:
  for y in range(n):
  	if a[y]==max(a):
  		
  		print(c)
  	else:
  		print(max(a))
else:
  for i in range(n):
    print(max(a))

Fixed submission:
##C
n=int(input())
a=list(int(input()) for i in range(n))
b=sorted(a)

for i in range(n):
    if a[i]==b[-1]:
        print(b[-2])
    else:
        print(b[-1])

Buggy python submission (verdict: Runtime Error):
n=int(input())
a=list(int(input()) for i in range(n))
if a.count(max(a))==1:
  for y in range(n):
  	if a[y]==max(a):
  		a.remove(a[y])
  		print(max(a))
  	else:
  		print(max(a))
else:
  for i in range(n):
    print(max(a))



Fixed submission:
##C
n=int(input())
a=list(int(input()) for i in range(n))
b=sorted(a)

for i in range(n):
    if a[i]==b[-1]:
        print(b[-2])
    else:
        print(b[-1])

Buggy python submission (verdict: Runtime Error):
n=int(input())
a=list(int(input()) for i in range(n))
for y in range(n):
  if a[y]==max(a):
  	a.remove(a[y])
  	print(max(a))
  else:
  	print(max(a))

Fixed submission:
##C
n=int(input())
a=list(int(input()) for i in range(n))
b=sorted(a)

for i in range(n):
    if a[i]==b[-1]:
        print(b[-2])
    else:
        print(b[-1])

Buggy python submission (verdict: Runtime Error):
n=int(input())
a=list(int(input()) for i in range(n-1))
if a[i]=max(a) for i in range(n-1):
  a.remove(a[i])
  print(max[a])
else:
  print(max[a])



Fixed submission:
##C
n=int(input())
a=list(int(input()) for i in range(n))
b=sorted(a)

for i in range(n):
    if a[i]==b[-1]:
        print(b[-2])
    else:
        print(b[-1])

Buggy python submission (verdict: Runtime Error):
n=int(input())
a=
a=list(int(input()) for i in range(n-1))
if a[i]=max(a) for i in range(n-1):
  a.remove(a[i])
  print(max[a])
else:
  print(max[a])

Fixed submission:
##C
n=int(input())
a=list(int(input()) for i in range(n))
b=sorted(a)

for i in range(n):
    if a[i]==b[-1]:
        print(b[-2])
    else:
        print(b[-1])

Buggy python submission (verdict: Runtime Error):
n=int(input())
a=list[int(input()) for i in range(n-1)]
if a[i]=max(a) for i in range(n-1):
  a.remove(a[i])
  print(max[a])
else:
  print(max[a])

Fixed submission:
##C
n=int(input())
a=list(int(input()) for i in range(n))
b=sorted(a)

for i in range(n):
    if a[i]==b[-1]:
        print(b[-2])
    else:
        print(b[-1])