#include <bits/stdc++.h>
using namespace std;
int main() {
  string n;
  cin >> n;
  int count = 0;
  vector<int> in;
  for (int i = 0; i < n.length(); i++) {
    if ((n[i] - '0') % 2 == 0) {
      count++;
      in.push_back(i);
    }
  }
  if (count == 0)
    cout << -1 << endl;
  else if (count == 1) {
    swap(n[n.length() - 1], n[in[0]]);
    cout << n << endl;
  } else {
    bool swapped = false;
    for (int i = 0; i < in.size(); i++) {
      if (n[in[i]] < (n[n.length() - 1])) {
        swap(n[n.length() - 1], n[in[i]]);
        swapped = true;
        break;
      }
    }
    if (!swapped) swap(n[n.length() - 1], n[in[in.size() - 1]]);
    cout << n << endl;
  }
  return 0;
}
