Solve for g f=2gh+2gk