#include <bits/stdc++.h>
using namespace std;
const int MAXN = 5000;
char str[MAXN];
int n, sum[MAXN], T;
void Even_But_Not_Even() {
  cin >> n >> (str + 1);
  if (n == 1 && ((str[1] - '0') % 2 == 1 || str[1] == '0')) {
    cout << -1 << endl;
    return;
  }
  for (int i = 1; i <= n; i++) sum[i] = sum[i - 1] + str[i] - '0';
  int len = -1;
  for (int i = n; i >= 1; i--)
    if ((str[i] - '0') % 2 == 1) {
      len = i;
      break;
    }
  if (len == -1) {
    cout << -1 << endl;
    return;
  }
  if (sum[len] % 2 == 0) {
    for (int i = 1; i <= len; i++) cout << str[i];
    cout << endl;
  } else {
    int flag = -1;
    for (int i = 1; i < len; i++) {
      if ((str[i] - '0') % 2 == 1) {
        flag = i;
        break;
      }
    }
    if (flag == -1) {
      cout << -1 << endl;
      return;
    }
    bool ck = 0;
    for (int i = 1; i <= len; i++) {
      if (i == flag) continue;
      if (str[i] != '0') ck = 1;
      if (ck == 0 && str[i] == '0') continue;
      cout << str[i];
    }
    cout << endl;
  }
}
int main() {
  cin >> T;
  while (T--) Even_But_Not_Even();
  return 0;
}
