#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int i, j, k, l, t, n;
  cin >> t;
  while (t--) {
    cin >> n;
    int a[n];
    char c;
    map<int, int> m;
    long long int oi = -1, ei = -1, le = -1, lo = -1;
    for (i = 0; i < n; i++) {
      cin >> c;
      a[i] = c - 48;
      if (a[i] % 2 == 0) {
        m[2]++;
        if (ei == -1) ei = i;
        le = max(le, i);
      } else {
        m[1]++;
        if (oi == -1) oi = i;
        lo = max(lo, i);
      }
    }
    if (a[n - 1] % 2 != 0) {
      if (oi == n - 1)
        cout << "-1" << endl;
      else if (m[1] % 2 == 0) {
        for (i = 0; i < n; i++) cout << a[i];
        cout << endl;
      } else {
        long long int fl = 0;
        for (i = 0; i < n; i++) {
          if (fl == 0 && a[i] == 0) continue;
          if (i != oi) {
            cout << a[i];
            fl = 1;
          }
        }
        cout << endl;
      }
    } else {
      while (true) {
        if (a[n - 1] % 2 == 0)
          n--;
        else
          break;
      }
      if (oi == -1 || n <= 0)
        cout << "-1" << endl;
      else if (m[1] % 2 == 0) {
        for (i = 0; i < n; i++) cout << a[i];
        cout << endl;
      } else if (m[1] == 1)
        cout << "-1" << endl;
      else {
        long long int fl = 0;
        for (i = 0; i < n; i++) {
          if (fl == 0 && a[i] == 0) continue;
          if (i != oi) {
            cout << a[i];
            fl = 1;
          }
        }
        cout << endl;
      }
    }
  }
}
