uses System.Text.RegularExpressions; var s : string; begin readln(s); writeln(TrimRight(Regex.Replace(s, '\s{2,}', ' '))); end.