#include <bits/stdc++.h>
using namespace std;
const long long N = 1e9 + 7;
signed main() {
  ios_base::sync_with_stdio(0);
  cin.tie(NULL);
  cout.tie(NULL);
  long long t, n;
  string s;
  cin >> t;
  while (t--) {
    cin >> n;
    cin >> s;
    long long i = n - 1;
    while (i >= 0) {
      if ((s[i] - '0') % 2 == 0)
        s.pop_back();
      else
        break;
      i--;
    }
    if (i <= 0) {
      cout << "-1\n";
      continue;
    }
    long long sum = 0;
    for (long long i = 0; i < s.length(); i++) sum += s[i] - '0';
    i = s.length() - 2;
    while (i >= 0) {
      if (sum % 2 != 0 and (s[i] - '0') % 2 != 0) {
        sum -= s[i] - '0';
        s.erase(s.begin() + i);
        break;
      }
      i--;
    }
    if (sum % 2 != 0 or s.length() == 0 or (s.length() > 0 and s[0] == '0'))
      cout << "-1\n";
    else
      cout << s << '\n';
  }
}
