using System.Collections.Generic;
namespace ProgramNamespace {
public static Dictionary < String, int > processData(
IEnumerable < string > lines) {
Dictionary < String, int > retVal = new Dictionary < String, int > ();
int maxVal = Convert.ToInt32((lines.Last().Split(','))[3]);
int[] votes = new int[maxVal + 1];
foreach(string line in lines) {
var arr = line.Split(',');
int userid = Convert.ToInt32(arr[0]);
int userVote = Convert.ToInt32(arr[3]);
if (!retVal.ContainsKey(arr[2])) {
retVal.Add(arr[2], userid);
votes[userid] = userVote;
int val = votes[retVal[arr[2]]];
votes[userid] = userVote;
static void Main(string[] args) {
Dictionary < String, int > retVal = processData(
File.ReadAllLines("input.txt"));
File.WriteAllLines("output.txt",
retVal.Select(x => x.Key + ": " + x.Value).ToArray());
} catch (IOException ex) {
Console.WriteLine(ex.Message);