using System.Collections.Generic;
using System.Text.RegularExpressions;
public static void Main()
var pattern = @"^([A-Z]{1}[a-z]+ [A-Z]{1}[a-z]+)$";
var regex = new Regex(pattern);
var names = new List<string>();
var input = Console.ReadLine();
var match = regex.Match(input);
names.Add(match.Groups[1].Value);
foreach(var name in names)