const rl = require("readline").createInterface({ input: process.stdin });

var iter = rl[Symbol.asyncIterator]();

const readline = async() => (await iter.next()).value;

void async function() {

    // Write your code here

    while (line = await readline()) {

        const maphash = new Map()

        let val = ''

        let flag = true

        for (let i = 0; i < line.length; i++) {

            val = maphash.get(line[i]) ? maphash.set(line[i], maphash.get(line[i]) + 1) : maphash.set(line[i], 1)

        }

        for (const [key, value] of val.entries()) {

            if (value === 1) {

                flag = false

                console.log(key)

                break

            } else {

                falg = true

            }

        }

        if (flag) {

            console.log(-1)

        }

    }

}()