fork(2) download
  1. using System;
  2. using System.Text.RegularExpressions;
  3.  
  4. public class Test
  5. {
  6. public static void Main()
  7. {
  8. try
  9. {
  10. while (true)
  11. Console.WriteLine(Regex.Replace(Console.ReadLine(), "^(?=.{5})([^ ]*)|.*", "$1"));
  12. }
  13. catch (ArgumentNullException)
  14. {
  15. }
  16. }
  17. }
Success #stdin #stdout 0.04s 134592KB
stdin
1
12
1 2
1 2 3
12 3
12345
1 2 3 4 5
12 34 56
123 456
1234 56
12345 6
123456
123456 789
stdout


1

12345
1
12
123
1234
12345
123456
123456