var l = Array(String(readLine()!)).sorted(by: >) var s = Set(l) var t = l t.removeAll(where: {$0 == "0"}) if s.count < 2 || t.count == 1{ 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()) }