Na, Mg, Al and P belong to 3rd period but are placed in first, second, thirteenth and fifteenth group

Na, Mg, Al and P belong to 3rd period but are placed in first, second, thirteenth and fifteenth group. Number of shells occupied in Mg is three. What is the number of occupied shells in Na, A1 and P ? Give reason for your answer.

It is three in Na, Al and P. Elements with the same number of occupied shells are placed in same period.