Solved medium version