FCTRL solved. Same algo in Go and C++ but Judge accepted C++