#include <bits/stdc++.h>
using namespace std;
int main() {
  int t;
  while (cin >> t) {
    while (t--) {
      int n, t1 = 0;
      cin >> n;
      string s;
      char s1[5005];
      cin >> s;
      int sum = 0;
      for (int i = 0; i < n; i++) {
        sum += s[i] - '0';
      }
      if (sum == 0) {
        cout << -1 << endl;
        continue;
      }
      bool flag = true;
      for (int i = n - 1; i >= 0; i--) {
        if ((s[i] - '0') % 2) {
          n = i + 1;
          break;
        }
        sum -= s[i] - '0';
      }
      if (sum == 0) {
        cout << -1 << endl;
        continue;
      }
      if (sum % 2 == 0) {
        for (int i = 0; i < n; i++) cout << s[i];
        cout << endl;
        continue;
      }
      for (int i = 0; i < n - 1; i++) {
        if (flag && (s[i] - '0') % 2) {
          flag = !flag;
          continue;
        }
        s1[t1++] = s[i];
      }
      s1[t1++] = s[n - 1];
      if (flag) {
        cout << -1 << endl;
        continue;
      }
      flag = false;
      for (int i = 0; i < t1; i++) {
        if (!flag && s1[i] == '0') continue;
        flag = true;
        cout << s1[i];
      }
      if (!flag) {
        cout << -1 << endl;
        continue;
      }
      cout << endl;
    }
  }
  return 0;
}
