Buggy python submission (verdict: Runtime Error):
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)
  


Fixed submission:
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)

Buggy python submission (verdict: Runtime Error):
n=int(input())
a=list(int,input().split(), for _ in range(0,n))
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)
  


Fixed submission:
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)

Buggy python submission (verdict: Runtime Error):
n=int(input())
a=list(map(int,input().split()))

value=max(a)
index=a.index(max(a))

for i in range(n):
  if i==index:
    b=a.pop(i)
    print(max(a))
  else:
      print(value)

Fixed submission:
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)

Buggy python submission (verdict: Runtime Error):
n=int(input())
a=list(map(int,input().split()))
val=max(a)
inx=a.index(val)

for i in range(0,n):
  if i==inx:
    del a[inx]
    print(max(a))
  else:
    print(val)
  


Fixed submission:
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)

Buggy python submission (verdict: Runtime Error):
n=int(input())
a=list(map(int,input().split()))
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)
  


Fixed submission:
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)

Buggy python submission (verdict: Runtime Error):
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[y]
    print(max(a))
  


Fixed submission:
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)

Buggy python submission (verdict: Runtime Error):
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:
    a.pop(y)
    print(max(a))
  


Fixed submission:
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)

Buggy python submission (verdict: Runtime Error):
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 submission:
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)