#include <bits/stdc++.h>
using namespace std;
const int MAXN = 3005;
int t, n;
char a[MAXN];
int ch(char c) { return c - '0'; }
int main() {
  scanf("%d", &t);
  while (t--) {
    int sum = 0, mark = 0;
    scanf("%d%s", &n, a + 1);
    while (n >= 1 && ch(a[n]) % 2 == 0) n--;
    if (n == 0) {
      puts("-1");
      continue;
    }
    for (int i = 1; i <= n; i++) sum += ch(a[i]);
    if (sum % 2 == 0) {
      for (int i = 1; i <= n; i++) printf("%c", a[i]);
      puts("");
      continue;
    }
    if (sum & 1) {
      for (int i = n - 1; i >= 1; i--)
        if (ch(a[i]) & 1) {
          mark = i;
          break;
        }
      if (mark == 0) {
        puts("-1");
        continue;
      }
      int f = 1;
      if (mark == 1) {
        f = 2;
        while (ch(a[f]) == 0) f++;
      }
      if (f > n) {
        puts("-1");
        continue;
      }
      for (int i = f; i <= n; i++)
        if (i != mark) printf("%c", a[i]);
      puts("");
    }
  }
  return 0;
}
