#include <bits/stdc++.h>
using namespace std;
const long long int mod = 998244353;
const long long int MAXN = 3e3 + 5;
const long long int inf = 1e17;
int main() {
  ios_base::sync_with_stdio(false);
  cout.tie(0);
  cin.tie(0);
  ;
  long long int t;
  cin >> t;
  while (t--) {
    long long int n;
    cin >> n;
    vector<char> v(n);
    for (int i = 0; i < n; i++) cin >> v[i];
    long long int a = v.back() - '0';
    while (a % 2 == 0) {
      v.pop_back();
      if (v.size() > 0)
        a = v.back() - '0';
      else
        break;
    }
    if (v.size() < 2) {
      cout << "-1" << endl;
      continue;
    }
    long long int sum = 0;
    for (int i = 0; i < v.size(); i++) {
      a = v[i] - '0';
      sum += a;
    }
    if (sum % 2 == 0) {
      for (auto i : v) cout << i;
      cout << endl;
      continue;
    }
    long long int ind = -1;
    for (int i = v.size() - 2; i > -1; i--) {
      a = v[i] - '0';
      if (a % 2) {
        ind = i;
        break;
      }
    }
    if (ind == 0 && v[1] == '0') ind = -1;
    if (ind != 0 && v[0] == '0') ind = -1;
    if (ind == -1)
      cout << "-1" << endl;
    else {
      for (int i = 0; i < v.size(); i++) {
        if (i != ind) cout << v[i];
      }
      cout << endl;
    }
  }
}
