using System; using System.Linq; using System.Text.RegularExpressions; public static class P { static void Main() { var s = Console.ReadLine().TrimStart('w'); var maxLen = Regex.Matches(s, @"w+").DefaultIfEmpty(Match.Empty).Max(x => x.Value.Length); if (maxLen == 0) return; var res = Regex.Matches(s, $@"([^w]+)w{{{maxLen}}}").Select(x => x.Groups[1].Value).ToArray(); Console.WriteLine(string.Join("\n", res)); } }