#include <bits/stdc++.h>
using namespace std;
int main() {
  cin.tie(NULL);
  ios::sync_with_stdio(false);
  int t, i, n;
  string str;
  cin >> t;
  while (t--) {
    int sm = 0, w = 0;
    cin >> n;
    cin >> str;
    for (i = 0; i < n; i++) sm += str[i] - '0';
    if (sm % 2 != 0) w = 1;
    int idx = n - 1;
    if (w == 1 || (str[n - 1] - '0') % 2 == 0) {
      while (w == 1 || (idx >= 0 && (str[idx] - '0') % 2 == 0)) {
        if (w == 1 && (str[idx] - '0') % 2 == 1) w = 0;
        str[idx] = -1;
        idx--;
      }
    }
    if (idx == -1)
      cout << "-1\n";
    else {
      for (i = 0; i < n; i++) {
        if (str[i] != -1) cout << str[i];
      }
      cout << '\n';
    }
  }
  return 0;
}
