ICFP contest Last Man Standing Team solution