#include <bits/stdc++.h>
using namespace std;
int main() {
  string s;
  cin >> s;
  int a = -1;
  int x = 0;
  for (int i = 0; i < s.size(); i++) {
    if (s[i] % 2 != 0) continue;
    a = i;
    if (s[i] < s[s.size() - 1]) break;
  }
  if (a != -1) {
    swap(s[a], s[s.size() - 1]);
    cout << s;
  } else
    cout << -1;
}
