P4 solution