#include <bits/stdc++.h>
using namespace std;
int s[3030];
bool u[3030];
int b[3030], k2, t, k, n;
int main() {
  cin >> t;
  while (t--) {
    cin >> n;
    k2 = 0;
    k = 0;
    for (int i = 1; i <= n; i++) {
      char c;
      cin >> c;
      s[i] = c - '0';
      if (s[i] % 2) k++;
    }
    while (n && s[n] % 2 == 0) {
      n--;
    }
    int pos = 0;
    if (k % 2) {
      for (int i = 1; i <= n; i++)
        if (s[i] % 2) {
          pos = i;
          break;
        }
      if (pos == n) {
        cout << "-1\n";
        continue;
      }
    }
    for (int i = 1; i <= n; i++) {
      if (i == pos) continue;
      if (k2 == 0 && s[i] == 0) continue;
      b[++k2] = s[i];
    }
    if (!k2) {
      cout << "-1\n";
    } else {
      for (int i = 1; i <= k2; i++) cout << b[i];
      cout << '\n';
    }
  }
  return 0;
}
