Simple programming puzzle to model train stations using graphs