Four elements P, Q, R and S have atomic numbers of 4, 10, 12 and…