#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int t;
  cin >> t;
  while (t--) {
    long long int n;
    cin >> n;
    long long int answer;
    long long int flag = 0;
    long long int end_idx = n;
    string input;
    cin >> input;
    long long int input_num[10000] = {-1};
    long long int sum = 0;
    for (long long int i = 0; i < n; ++i) {
      if (input[i] == '0')
        input_num[i] = 0;
      else if (input[i] == '1')
        input_num[i] = 1;
      else if (input[i] == '2')
        input_num[i] = 2;
      else if (input[i] == '3')
        input_num[i] = 3;
      else if (input[i] == '4')
        input_num[i] = 4;
      else if (input[i] == '5')
        input_num[i] = 5;
      else if (input[i] == '6')
        input_num[i] = 6;
      else if (input[i] == '7')
        input_num[i] = 7;
      else if (input[i] == '8')
        input_num[i] = 8;
      else
        input_num[i] = 9;
      sum += input_num[i];
    }
    for (long long int i = n - 1; i >= 0; --i) {
      if (((input_num[i] % 2) == 0) && i > 0) {
        sum -= input_num[i];
        input_num[i] = -1;
        flag = 0;
      } else if (i == 0) {
        if (flag == 0) {
          if (input_num[i] % 2 == 0)
            flag = 0;
          else
            flag = 0;
        }
      } else {
        end_idx = i;
        flag = 1;
        break;
      }
    }
    if (flag == 1) {
      if (sum % 2 == 1) {
        for (long long int j = 0; j <= end_idx; ++j) {
          if ((input_num[j] % 2) == 1 && j != end_idx) {
            sum -= input_num[j];
            input_num[j] = -1;
            break;
          }
        }
      }
    }
    if (sum % 2 == 1) flag = 0;
    for (long long int i = 0; i < n; ++i) {
      if (input_num[i] == 0 || input_num[i] == -1)
        input_num[i] = -1;
      else
        break;
    }
    if (flag == 0)
      cout << -1;
    else {
      for (long long int j = 0; j < n; ++j) {
        if (input_num[j] != -1) cout << input_num[j];
      }
    }
    cout << endl;
  }
}
