#include <bits/stdc++.h>
using namespace std;
long long sod(string s, int n) {
  long long sum = 0;
  for (int i = 0; i < n; i++) {
    sum = sum + (s[i] - '0');
  }
  return sum;
}
string eben(string s) {
  int n = s.length();
  long long sum = sod(s, n);
  if (sum % 2 == 0 && n > 1)
    return s;
  else {
    for (int i = s.length() - 1; i >= 0; i--) {
      s.erase(s.begin() + i);
      if ((s[s.length() - 1] - '0') % 2 != 0) {
        return s;
      }
    }
  }
  string s1 = "";
  return s1;
}
string rec(string s) {
  int n = s.length();
  for (int i = n - 1; i >= 0; i--) {
    if ((s[i] - '0') % 2 != 0) {
      s = s.substr(0, i + 1);
      return s;
    }
  }
  return s;
}
int main() {
  int t;
  cin >> t;
  while (t--) {
    int n;
    cin >> n;
    string s;
    cin >> s;
    string ss = s;
    if (n == 1) {
      cout << -1 << endl;
      continue;
    }
    long long sum = sod(s, n);
    if (sum % 2 == 0 && (s[n - 1] - '0') % 2 != 0) {
      cout << s << endl;
    } else {
      int flag = 0;
      if ((s[n - 1] - '0') % 2 == 0) {
        for (int i = n - 1; i >= 0; i--) {
          if ((s[i] - '0') % 2 != 0) {
            s = s.substr(0, i + 1);
            flag = 1;
            break;
          }
        }
        if (s == "" || flag != 1) {
          cout << -1 << endl;
          continue;
        }
        string s1 = eben(s);
        s1 = rec(s1);
        if (s1 != "")
          cout << s1 << endl;
        else
          cout << -1 << endl;
      } else {
        string s1 = eben(s);
        int n = s1.length();
        if ((s1[n - 1] - '0') % 2 == 0) {
        }
        if (s1 != "")
          cout << s1 << endl;
        else
          cout << -1 << endl;
      }
    }
  }
}
