Solution to FCTRL in Python

4M, 2.8s