solve of F problem