#include <bits/stdc++.h>
long long z = 1000000007;
long long inf = 100000000000000000;
long long gcd(long long a, long long b) {
  if (b > a) return gcd(b, a);
  if (b == 0) return a;
  return gcd(b, a % b);
}
long long power(long long a, long long b) {
  if (b <= 0) return 1;
  long long c = power(a, b / 2);
  if (b % 2 == 0)
    return ((c * c) % z);
  else
    return ((((c * c) % z) * a) % z);
}
long long inverse(long long a, long long n) { return power(a, n - 2); }
long long max(long long a, long long b) {
  if (a > b) return a;
  return b;
}
using namespace std;
int main() {
  long long t;
  cin >> t;
  while (t--) {
    long long n;
    cin >> n;
    string str;
    cin >> str;
    long long sum = 0;
    for (long long i = 0; i < n; i++) {
      sum += (long long)(str[i] - '0');
    }
    long long ind = n - 1;
    if (sum % 2 == 0) {
      for (; ind >= 0; ind--) {
        if (((long long)(str[ind] - '0')) % 2 == 1) {
          break;
        }
      }
    } else {
      int flag = 0;
      for (; ind >= 0; ind--) {
        if (((long long)(str[ind] - '0')) % 2 == 1) {
          if (flag == 0)
            flag = 1;
          else
            break;
        }
      }
    }
    if (ind < 0) {
      cout << -1 << '\n';
    } else {
      for (long long i = 0; i <= ind; i++) {
        cout << str[i];
      }
      cout << '\n';
    }
  }
  return 0;
}
