#include <bits/stdc++.h>
using namespace std;
const int N6 = 1e6 + 6, N3 = 1e3 + 6, oo = 1e9 + 9;
const long long ool = 1e18 + 9;
string s;
bool ok, ok2;
int old = 0;
int main() {
  ios_base ::sync_with_stdio(0);
  cin >> s;
  int n = s.size();
  for (int i = 0; i <= n - 2; ++i) {
    int x = s[i] - '0';
    if (x & 1) continue;
    ok = 1;
    if (x < s[n - 1] - '0') {
      swap(s[i], s[n - 1]);
      ok2 = 1;
      break;
    }
    old = i;
  }
  if (!ok) {
    cout << -1;
    return 0;
  }
  if (!ok2) {
    swap(s[old], s[n - 1]);
  }
  cout << s;
  return 0;
}
