#include <bits/stdc++.h>
using namespace std;
#pragma GCC optimize("Ofast")
#pragma GCC target("avx,avx2,fma")
bool binary_search(int arr[], int x, int l, int n) {
  int mid = (x) + (l - x) / 2;
  if (x >= l) {
    return false;
  } else if (arr[mid] == n) {
    return true;
  } else if (arr[mid] < n) {
    x = mid;
    return binary_search(arr, x, l, n);
  } else if (arr[mid] > n) {
    l = mid;
    return binary_search(arr, x, l, n);
  }
  return false;
}
int gcd(int a, int b) {
  if (b == 0) return a;
  return gcd(b, a % b);
}
long long lcm(int a, int b) { return (a / gcd(a, b)) * b; }
string IntToString(long long int a) {
  char x[100];
  sprintf(x, "%lld", a);
  string s = x;
  return s;
}
bool is_prime(long long int n) {
  if (n == 1) {
    return false;
  }
  int i = 2;
  while (i * i <= n) {
    if (n % i == 0) {
      return false;
    }
    i += 1;
  }
  return true;
}
long long int SieveOfEratosthenes(int n) {
  long long int count = 0;
  bool prime[n + 1];
  memset(prime, true, sizeof(prime));
  for (long long int p = 2; p * p <= n; p++) {
    if (prime[p] == true) {
      for (long long int i = p * 2; i <= n; i += p) prime[i] = false;
    }
  }
  for (long long int p = 2; p <= n; p++) {
    if (prime[p]) {
      if (n % p == 0) count++;
    }
  }
  return count;
}
void solve() {
  string s;
  cin >> s;
  int max = 0;
  int t = s[s.length() - 1] - '0';
  int count = 0;
  int min = 100000000;
  for (int i = 0; i < s.length(); i++) {
    if (int(s[i] - '0') % 2 == 0) {
      count++;
      if ((s[i] - '0') > max) {
        max = s[i] - '0';
      }
      if ((s[i] - '0') < min) {
        min = s[i] - '0';
      }
    }
  }
  if (count == 0) {
    cout << -1 << endl;
    return;
  }
  if (max > t) {
    if (min < t) {
      for (int i = 0; i < s.length() - 1; i++) {
        if (t > (s[i] - '0') && ((s[i] - '0') % 2 == 0)) {
          s[s.length() - 1] = s[i];
          s[i] = t + '0';
          break;
        }
      }
    } else {
      for (int i = s.length() - 2; i >= 0; i--) {
        if (((s[i] - '0') % 2 == 0)) {
          s[s.length() - 1] = s[i];
          s[i] = t + '0';
          break;
        }
      }
    }
    cout << s << endl;
  } else {
    for (int i = 0; i < s.length() - 1; i++) {
      if ((s[i] - '0') % 2 == 0) {
        s[s.length() - 1] = s[i];
        s[i] = t + '0';
        break;
      }
    }
    cout << s << endl;
  }
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int t = 1;
  while (t--) {
    solve();
  }
  return 0;
}
