#include <bits/stdc++.h>
using namespace std;
const long long mod = 1000000007;
vector<int> prime(1000001, 0);
void sieve() {
  for (int p = 2; p * p <= 1000000; p++) {
    if (prime[p] == 0) {
      for (int i = p * 2; i <= 1000000; i += p) prime[i] = 1;
    }
  }
}
void solve() {
  string str;
  cin >> str;
  int n = str.length();
  int ind = -1;
  for (int i = 0; i < n - 1; i++) {
    if ((str[i] - '0') % 2 == 0) {
      ind = i;
      if (str[i] < str[n - 1]) break;
    }
  }
  if (ind == -1)
    cout << -1;
  else {
    swap(str[ind], str[n - 1]);
    cout << str;
  }
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  solve();
  return 0;
}
