fn next_valid(s: &str) -> String