var l = Array(String(readLine()!)).sorted(by: >) var s = Set(l) if s.count < 2 || (l.count == 2 && l.contains("0")){ print(-1) }else{ let e = l[l.count - 1] let f = l.firstIndex(of: e)! (l[f - 1],l[f]) = (l[f],l[f - 1]) print(l.map{String($0)}.joined()) }