Karthik's submission of Social Network | CodeChef