# Problem Description

We have N sticks with negligible thickness. The length of the i-th stick is Ai.

Snuke wants to select four different sticks from these sticks and form a rectangle (including a square), using the sticks as its sides. Find the maximum possible area of the rectangle.

# Constraints

• 4≤N≤105
• 1≤Ai≤109
• Ai is an integer.

# Input

Input is given from Standard Input in the following format:

N
A1 A2 ... AN

# Output

Print the maximum possible area of the rectangle. If no rectangle can be formed, print 0.

# Example

Sample Input 1

6
3 1 2 4 2 1

Sample Output 1

2
1×2 rectangle can be formed.

Sample Input 2

4
1 2 3 4

Sample Output 2

0
No rectangle can be formed.

Sample Input 3

10
3 3 3 3 4 4 4 5 5 5

Sample Output 3

20

# Source Program

#include<iostream>
#include<cstdio>
#include<cstdlib>
#include<string>
#include<cstring>
#include<cmath>
#include<ctime>
#include<algorithm>
#include<utility>
#include<stack>
#include<queue>
#include<vector>
#include<set>
#include<map>
#include<bitset>
#define EPS 1e-9
#define PI acos(-1.0)
#define INF 0x3f3f3f3f
#define LL long long
const int MOD = 1E9+7;
const int N = 100000+5;
const int dx[] = {-1,1,0,0,-1,-1,1,1};
const int dy[] = {0,0,-1,1,-1,1,-1,1};
using namespace std;
struct cmp{
bool operator()(const LL &a,const LL &b){
return a>b;
}
};
multiset<LL,cmp> s;
int main() {
int n;
scanf("%d",&n);
for(int i=1;i<=n;i++){
LL x;
scanf("%lld",&x);
s.insert(x);
}

multiset<LL>::iterator it;
priority_queue<LL> Q;
LL maxx=0;
int num=0;
for(it=s.begin();it!=s.end();it++){
if(*it==maxx)
num++;
else{
maxx=*it;
num=1;
}
if(num>=2){
num=0;
Q.push(*it);
}
}
if(Q.size()<2)
printf("0\n");
else{
LL w=Q.top();Q.pop();
LL h=Q.top();Q.pop();
printf("%lld\n",w*h);
}
return 0;
}