#include <bits/stdc++.h>
using namespace std;
int a[5000];
int main() {
  int T, n, i;
  cin >> T;
  while (T--) {
    int flag = 0, sum = 0;
    cin >> n;
    for (i = 0; i < n; i++) {
      scanf("%1d", &a[i]);
      if (a[i] % 2) flag++;
      sum += a[i];
    }
    if (flag >= 2) {
      for (i = 0; i < n; i++) {
        if (a[i] % 2) {
          cout << a[i];
          break;
        }
      }
      i++;
      for (; i < n; i++) {
        if (a[i] % 2) {
          cout << a[i] << "\n";
          break;
        }
      }
    } else {
      cout << "-1\n";
    }
  }
  return 0;
}
