use std::collections::HashSet; fn main() { let mut s = String::new(); std::io::stdin().read_line(&mut s).ok(); let s = s.trim(); if s.chars().filter(|&c| c != '0').count() < 2 || s.chars().collect::>().len() < 2 { println!("-1"); return; } let mut c: Vec<_> = s.chars().collect(); c.sort(); for i in 1.. { if c[i] != c[0] { c.swap(i, i - 1); break; } } println!("{}", c.iter().rev().collect::()) }