#include<cstdio>
#include<vector>
#include<queue>
#define maxn 1010
using namespace std;
int c[maxn];
struct node {
int d, level;
node *left, *right;
};
void inser(node* &r, int a) {
if (r == NULL) {
r = new node;
r->d = a;
r->left = NULL;
r->right = NULL;
return;
}
if (a <= r->d) {
inser(r->left, a);
}
else inser(r->right, a);
}
void levelorder(node *root) {
if (root == NULL) return;
root->level = 0;
queue<node> q;
q.push(*root);
while(!q.empty()) {
node temp = q.front();
int tl = temp.level;
q.pop();
c[tl]++;
if (temp.left != NULL) {
(temp.left)->level = tl + 1;
q.push(*(temp.left));
}
if (temp.right != NULL) {
(temp.right)->level = tl + 1;
q.push(*(temp.right));
}
}
return;
}
int main() {
int N, a;
scanf("%d", &N);
node *root = NULL;
for (int i = 0; i < N; i++) {
scanf("%d", &a);
inser(root, a);
}
for (int i = 0; i < maxn; i++) {
c[i] = 0;
}
levelorder(root);
int fmax, smax, j;
for (j = maxn - 1; j >= 0; j--) {
if (c[j] > 0) {
fmax = j;
break;
}
}
j--;
smax = j;
printf("%d + %d = %d\n", c[fmax], c[smax], c[fmax] + c[smax]);
return 0;
}