#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int t;
  cin >> t;
  while (t--) {
    int n;
    cin >> n;
    string s = "";
    int sum = 0;
    char c;
    int flag = 0;
    for (long long i = 0; i < n; i++) {
      cin >> c;
      if (c != '0') flag = 1;
      if (flag == 1) {
        s += c;
        sum += (c - '0');
      }
    }
    if (s.length() == 0)
      cout << -1 << '\n';
    else if ((c - '0') % 2 == 0) {
      if (sum % 2 == 0) {
        int i = n - 1;
        while (i >= 0 && (s[i] - '0') % 2 == 0) {
          s.erase(i, 1);
          i--;
        }
        if (s.length() == 0)
          cout << -1 << '\n';
        else
          cout << s << '\n';
      } else {
        int i = n - 1;
        while (i >= 0 && (s[i] - '0') % 2 == 0) {
          s.erase(i, 1);
          i--;
        }
        int j = 0;
        while (j < s.length() && (s[j] - '0') % 2 == 0) {
          j++;
        }
        if (j + 1 == s.length())
          cout << -1 << '\n';
        else {
          s.erase(j, 1);
          int j = 0;
          while (s.length() > 0 && s[j] == '0') s.erase(j, 1);
          if (s.length() == 0)
            cout << -1 << '\n';
          else
            cout << s << '\n';
        }
      }
    } else {
      if (sum % 2 == 0) {
        cout << s << '\n';
      } else {
        int j = 0;
        while (j < s.length() && (s[j] - '0') % 2 == 0) {
          j++;
        }
        if (j + 1 == s.length())
          cout << -1 << '\n';
        else {
          s.erase(j, 1);
          int j = 0;
          while (s.length() > 0 && s[j] == '0') s.erase(j, 1);
          if (s.length() == 0)
            cout << -1 << '\n';
          else
            cout << s << '\n';
        }
      }
    }
  }
  return 0;
}
