#include <bits/stdc++.h>
using namespace std;
int main() {
  int i, t;
  cin >> t;
  bool pp;
  while (t--) {
    char s[3005];
    pp = true;
    int n;
    cin >> n >> s;
    long long sum = 0;
    int j;
    int p = strlen(s);
    for (i = 0; s[i] != '\0'; i++) {
      sum += s[i] - '0';
    }
    for (i = p - 1; i >= 0; i--) {
      if ((s[i] - '0') % 2 != 0) {
        break;
      } else {
        sum -= s[i] - '0';
        s[i] = 'c';
      }
    }
    if (s[0] != 'c') {
      if (sum % 2 == 0) {
        for (i = 0; s[i] != '\0'; i++) {
          if ((s[i] != 'c'))
            cout << s[i];
          else
            break;
        }
        cout << endl;
      } else {
        for (i = 0; s[i] != '\0'; i++) {
          if ((s[i] - '0') % 2 != 0) {
            if (i == 0) {
              if (s[i + 1] != '\0') {
                if (s[i + 1] != '0') {
                  s[i] = 'd';
                  break;
                }
              } else
                pp = false;
            } else {
              s[i] = 'd';
              break;
            }
          }
          if (!pp) break;
        }
        if (!pp) {
          cout << "-1" << endl;
          continue;
        }
        for (i = 0; s[i] != '\0'; i++) {
          if (s[i] == 'd') {
            j = i;
            break;
          }
        }
        bool tt = true;
        if (s[j + 1] == '\0' || s[j + 1] == 'c') {
          tt = false;
        }
        if (tt) {
          for (i = 0; s[i] != '\0'; i++) {
            if (s[i] != 'c' && s[i] != 'd') cout << s[i];
          }
          cout << endl;
        } else
          cout << -1 << endl;
      }
    } else
      cout << -1 << endl;
  }
  return 0;
}
