Buggy python submission (verdict: Runtime Error):
from collections import Counter

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

c = Counter(A)


ans = []
for i, j in c.items():
    if j >= 2:
        ans.append(i)

ans.sort()    

print(ans[-1]*ans[-2])

Fixed submission:
import collections
N = int(input())
A = list(map(int, input().split()))
a = collections.Counter(A)
ans = [0, 0]
for i in a.keys():
    if a[i] >= 2:
        ans.append(i)
    if a[i] >= 4:
        ans.append(i)
ans.sort()
print(ans[-1]*ans[-2])

Buggy python submission (verdict: Runtime Error):
from collections import Counter

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

    
c = Counter(A)


ans = []
for i, j in c.items():
    if j >= 2:
        ans.append[i]

ans.sort()    
print(ans[-1]*ans[-2])

Fixed submission:
import collections
N = int(input())
A = list(map(int, input().split()))
a = collections.Counter(A)
ans = [0, 0]
for i in a.keys():
    if a[i] >= 2:
        ans.append(i)
    if a[i] >= 4:
        ans.append(i)
ans.sort()
print(ans[-1]*ans[-2])

Buggy python submission (verdict: Runtime Error):
from collections import Counter

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

    
c = Counter(l)


ans = []
for i, j in c.items():
    if i >= 2:
        ans.append[j]

ans.sort()    
print(ans[-1]*ans[-2])

Fixed submission:
import collections
N = int(input())
A = list(map(int, input().split()))
a = collections.Counter(A)
ans = [0, 0]
for i in a.keys():
    if a[i] >= 2:
        ans.append(i)
    if a[i] >= 4:
        ans.append(i)
ans.sort()
print(ans[-1]*ans[-2])

Buggy python submission (verdict: Runtime Error):
import collections
N = int(input())
A = sorted(list(map(int, input().split())))
a = collections.Counter(A)
ans = 0
y = 0
for i in a.keys():
    if a[i] >= 2:
        x = y*i
        y = i
    if a[i] >= 4:
        z = i**2
    ans = max(ans, x, z)
print(ans)

Fixed submission:
import collections
N = int(input())
A = list(map(int, input().split()))
a = collections.Counter(A)
ans = [0, 0]
for i in a.keys():
    if a[i] >= 2:
        ans.append(i)
    if a[i] >= 4:
        ans.append(i)
ans.sort()
print(ans[-1]*ans[-2])

Buggy python submission (verdict: Runtime Error):
import collections
N = int(input())
A=sorted(list(map(int, input().split())))
a = collections.Counter(A)
ans = 0
y = 0
for i in a.keys():
    if a[i] >= 2:
        x = y*i
        y = i
    if a[i] >= 4:
        z = i**2
    ans = max(ans, x, z)
print(ans)

Fixed submission:
import collections
N = int(input())
A = list(map(int, input().split()))
a = collections.Counter(A)
ans = [0, 0]
for i in a.keys():
    if a[i] >= 2:
        ans.append(i)
    if a[i] >= 4:
        ans.append(i)
ans.sort()
print(ans[-1]*ans[-2])

Buggy python submission (verdict: Runtime Error):
import collections
N = int(input())
A=sorted(list(map(int, input().split())))
a = collections.Counter(A)
ans = 0
y = 0
for i in a.keys():
    if a[i] >= 2:
        x = y*i
        y = i
    if a[i] >= 4:
        z = i**2
    ans = max(ans, x, z)
print(ans)

Fixed submission:
import collections
N = int(input())
A = list(map(int, input().split()))
a = collections.Counter(A)
ans = [0, 0]
for i in a.keys():
    if a[i] >= 2:
        ans.append(i)
    if a[i] >= 4:
        ans.append(i)
ans.sort()
print(ans[-1]*ans[-2])