fn main()

in contests/abc223/abc223_b.rs [5:21]


fn main() {
    input! {
        S: String,
    }

    let mut chars = vec![];
    chars.push(S.clone());
    for i in 1..S.len() {
        let mut tmp_S = S.clone();
        let second_S = tmp_S.split_off(i);
        chars.push(second_S + &tmp_S);
    }
    chars.sort();

    println!("{}", chars[0]);
    println!("{}", chars[S.len() - 1]);
}