//ssenseeeeeeeeeeeeeeeeeeeeeeeeeeeee
#include<bits/stdc++.h>
#define startt ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
typedef unsigned long long ull;
typedef long long ll;
#define MOD 1000000007
#define MX 1000000000
#define MXL 1000000000000000
#define PI 3.14159265
#define pb push_back
using namespace std;
#define sc second
#define endl '\n'
#define fr first
int main(){
ll n;
cin >> n;
int a[n+1];
for(int i = 0; i < n; i++)
{
cin >> a[i];
}
int evenpos = -1;
sort(a, a+n);
reverse(a, a+n);
for(int i = 0; i < n; i++)
{
if(a[i]%2 == 0)
{
evenpos = i;
}
}
if(evenpos == -1)
{
cout << -1 << endl;
return 0;
}
for(int i = 0; i < n; i++)
{
if(i == evenpos)
{
continue;
}
cout << a[i];
}
cout << a[evenpos] << endl;
}
Ly9zc2Vuc2VlZWVlZWVlZWVlZWVlZWVlZWVlZWVlZWVlZWVlCiNpbmNsdWRlPGJpdHMvc3RkYysrLmg+CiNkZWZpbmUgc3RhcnR0IGlvc19iYXNlOjpzeW5jX3dpdGhfc3RkaW8oZmFsc2UpO2Npbi50aWUoMCk7Y291dC50aWUoMCk7CnR5cGVkZWYgdW5zaWduZWQgbG9uZyBsb25nIHVsbDsKdHlwZWRlZiBsb25nIGxvbmcgIGxsOwojZGVmaW5lIE1PRCAxMDAwMDAwMDA3CiNkZWZpbmUgTVggMTAwMDAwMDAwMAojZGVmaW5lIE1YTCAxMDAwMDAwMDAwMDAwMDAwCiNkZWZpbmUgUEkgMy4xNDE1OTI2NQojZGVmaW5lIHBiIHB1c2hfYmFjawp1c2luZyBuYW1lc3BhY2Ugc3RkOwojZGVmaW5lIHNjIHNlY29uZAojZGVmaW5lIGVuZGwgJ1xuJwojZGVmaW5lIGZyIGZpcnN0CgppbnQgbWFpbigpewogICAgbGwgbjsKICAgIGNpbiA+PiBuOwogICAgaW50IGFbbisxXTsKICAgIGZvcihpbnQgaSA9IDA7IGkgPCBuOyBpKyspCiAgICB7CiAgICAgICAgY2luID4+IGFbaV07CiAgICB9CiAgICBpbnQgZXZlbnBvcyA9IC0xOwogICAgc29ydChhLCBhK24pOwogICAgcmV2ZXJzZShhLCBhK24pOwogICAgZm9yKGludCBpID0gMDsgaSA8IG47IGkrKykKICAgIHsKICAgICAgICBpZihhW2ldJTIgPT0gMCkKICAgICAgICB7CiAgICAgICAgICAgIGV2ZW5wb3MgPSBpOwogICAgICAgIH0KICAgIH0KICAgIGlmKGV2ZW5wb3MgPT0gLTEpCiAgICB7CiAgICAgICAgY291dCA8PCAtMSA8PCBlbmRsOwogICAgICAgIHJldHVybiAwOwogICAgfQogICAgZm9yKGludCBpID0gMDsgaSA8IG47IGkrKykKICAgIHsKICAgICAgICBpZihpID09IGV2ZW5wb3MpCiAgICAgICAgewogICAgICAgICAgICBjb250aW51ZTsKICAgICAgICB9CiAgICAgICAgY291dCA8PCBhW2ldOwogICAgfQogICAgY291dCA8PCBhW2V2ZW5wb3NdIDw8IGVuZGw7Cn0K