#include <bits/stdc++.h>
using namespace std;
const long long mod = 1e9 + 7;
long long power(long long x, long long y, long long p) {
  long long res = 1;
  x = x % p;
  while (y > 0) {
    if (y & 1) res = (res * x) % p;
    y = y >> 1;
    x = (x * x) % p;
  }
  return res;
}
int main() {
  ios_base::sync_with_stdio(false);
  long long t, n;
  string s;
  cin >> t;
  while (t--) {
    cin >> n >> s;
    if (s == "0") {
      cout << -1 << '\n';
      continue;
    }
    long long ind;
    for (ind = n - 1; ind >= 0; ind--) {
      long long temp = s[ind] - '0';
      if (temp % 2 != 0) break;
    }
    if (ind == -1) {
      cout << -1 << '\n';
      continue;
    }
    string temp = "";
    long long sum = 0;
    for (long long i = 0; i <= ind; i++) {
      temp += s[i];
      long long no = s[i] - '0';
      sum += no;
    }
    if (sum % 2 == 0) {
      cout << temp << '\n';
      continue;
    }
    long long odd = -1;
    for (long long i = ind - 1; i >= 0; i--) {
      long long no = s[i] - '0';
      if (no % 2 == 1) {
        odd = i;
        break;
      }
    }
    if (odd == -1) {
      cout << -1 << '\n';
      continue;
    }
    string temp2 = "";
    for (long long i = 0; i <= ind; i++) {
      if (i != odd) {
        temp2 += s[i];
      }
    }
    if (temp2[0] == '0') {
      cout << -1 << '\n';
    } else {
      cout << temp2 << '\n';
    }
  }
  return 0;
}
