public string Process(string input) { string result; try { var lines = input.Split('\n'); var arena = new Arena(_parser.ParseDimensions(lines[0].Trim())); for (var index = 1; index < lines.Length; index += 2) { var robot = new Robot(_parser.ParsePosition(lines[index].Trim())); _parser.ParseCommands(lines[index + 1].Trim()).ForEach(command => { robot.AddCommand(command); }); arena.AddRobot(robot); } result = _parser.FormatPositions(arena.ReportRobotsPositions()); } catch (Exception ex) { result = $"Input is not in a correct format: {ex.Message}"; } return(result); }