Solve p123