Problem: Berland, 2016. The exchange rate of currency you all know against the burle has increased so much that to simplify the calculations, its fractional part was neglected and the exchange rate is now assumed to be an integer.

Reliable sources have informed the financier Anton of some information about the exchange rate of currency you all know against the burle for tomorrow. Now Anton knows that tomorrow the exchange rate will be an even number, which can be obtained from the present rate by swapping exactly two distinct digits in it. Of all the possible values that meet these conditions, the exchange rate for tomorrow will be the maximum possible. It is guaranteed that today the exchange rate is an odd positive integer n. Help Anton to determine the exchange rate of currency you all know for tomorrow!

Input

The first line contains an odd positive integer n — the exchange rate of currency you all know for today. The length of number n's representation is within range from 2 to 105, inclusive. The representation of n doesn't contain any leading zeroes.

Output

If the information about tomorrow's exchange rate is inconsistent, that is, there is no integer that meets the condition, print  - 1.

Otherwise, print the exchange rate of currency you all know against the burle for tomorrow. This should be the maximum possible number of those that are even and that are obtained from today's exchange rate by swapping exactly two digits. Exchange rate representation should not contain leading zeroes.

Examples

Input

527


Output

572


Input

4573


Output

3574


Input

1357997531


Output

-1

Solution (in JAVA):

Solution:

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.StringTokenizer;

/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 *
 * @author Melissa
 */
public class main {
    public static void main(String [] args) throws IOException{
        
        Scanner sc=new Scanner();
        StringBuilder cambio=new StringBuilder(sc.next());
        int aux, aux2, i, fin, indice;
        fin=cambio.charAt(cambio.length()-1)-48;
        aux2=-1;
        aux=0;
        indice=0;
        for(i=0; i<cambio.length(); i++){
            aux=cambio.charAt(i)-48;
            if(aux%2==0){
                aux2=aux;
                indice=i;
                if(aux2<fin){
                    break;
                }
            }
        }
        if(aux!=fin || aux2!=-1){
            cambio.replace(cambio.length()-1, cambio.length(), aux2+"");
            cambio.replace(indice, indice+1, fin+"");
            System.out.println(cambio);
        }else{
            System.out.println("-1");
        }
        
        
    }
    static class Scanner {

        InputStreamReader en = new InputStreamReader(System.in);
        BufferedReader in = new BufferedReader(en);
        StringTokenizer st = new StringTokenizer("");

        /*---------------------METODOS INDISPENSABLES------------------*/
        /**
         * Recibe linea a linea de la entrada estandar
         *
         * @return un string con la linea recibida
         * @throws IOException
         */
        public String nextLine() throws IOException {
            return in.readLine();
        }

        /**
         * Recibe un entero o rompe la ejecución si no hay mas datos
         *
         * @return entero con el numero recibido
         * @throws IOException
         */
        public int nextIntOrQuit() throws IOException {
            Integer n = nextInteger();
            if (n == null) {
                System.exit(0);
            }
            return n.intValue();
        }

        /**
         * Lee una palabra, separada por espacio o salto de linea
         *
         * @return string con la palabra
         * @throws IOException
         */
        public String next() throws IOException {
            while (!st.hasMoreTokens()) {
                String l = nextLine();
                if (l == null) {
                    return null;
                }
                st = new StringTokenizer(l);
            }
            return st.nextToken();
        }

        /**
         * Lee una palabra, separada por espacio o salto de linea, rompe la
         * ejecución si no existe la palabra
         *
         * @return string con la palabra
         * @throws IOException
         */
        public String nextOrQuit() throws IOException {
            while (!st.hasMoreTokens()) {
                String l = nextLine();
                if (l == null) {
                    System.exit(0);
                }
                st = new StringTokenizer(l);
            }
            return st.nextToken();
        }

        /**
         * Metodo que retorna el siguiente entero recibido por input estandar
         * IMPORTANTE: Retorna el dato con tipo primitivo int
         *
         * @return entero recibido por entrada estandar
         * @throws IOException
         */
        public int nextInt() throws IOException {
            return Integer.parseInt(next());
        }

        /**
         * Recibe el siguiente entero, no como tipo primitivo sino como tipo
         * Integer
         *
         * @return entero del tipo Integer (no primitivo)
         * @throws IOException
         */
        public Integer nextInteger() throws IOException {
            String s = next();
            if (s == null) {
                return null;
            }
            return Integer.parseInt(s);
        }
    }
}