using System; using System.Collections.Generic; using System.Text; using System.Linq; class Program { public void Proc() { Reader.IsDebug = false; string inpt = Reader.ReadLine(); string txt = string.Empty; string w = string.Empty; List list = new List(); for(int i=0; i 0) { list.Add(new Word(txt, w)); w = string.Empty; txt = string.Empty; } txt += inpt[i]; } } if(w.Length > 0) { list.Add(new Word(txt, w)); } if(list.Count(a=>a.Text.Length > 0) == 0) { Console.WriteLine(string.Empty); return; } int max = list.Where(a=>a.Text.Length > 0).Max(a=>a.Waros.Length); if(max == 0) { Console.WriteLine(string.Empty); return; } list.Where(a=>a.Waros.Length == max).ToList().ForEach(a=>Console.WriteLine(a.Text)); } public class Word { public String Text; public String Waros; public Word(string txt, string w) { this.Text = txt; this.Waros = w; } } public class Reader { public static bool IsDebug = true; private static String PlainInput = @" wwそれなww "; private static System.IO.StringReader Sr = null; public static string ReadLine() { if (IsDebug) { if (Sr == null) { Sr = new System.IO.StringReader(PlainInput.Trim()); } return Sr.ReadLine(); } else { return Console.ReadLine(); } } } static void Main() { Program prg = new Program(); prg.Proc(); } }