Mark Kornejchik's submission of Four Friends | CodeChef