2a

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
n=int(input())
a=[]
maxx=-1
for i in range(n):
a += [int(input())]
for i in range(n):
for j in range(n):
if(a[i]*a[j])%14==0 and a[i]*a[j]>maxx:
if i != j:
maxx=a[i]*a[j]
print(maxx)