The fourth period contains 18 elements, beginning with potassium and ending with krypton. As a rule, period 4 elements fill their 4s shells first, then their 3d and 4p shells, in that order
I think you are mistaken..atomic numbers 27-36 have only 4 shells..
For understanding that,write the subshell wise electronic configuration..
This gives the following order forfilling the orbitals: 1s, 2s, 2p, 3s, 3p, 4s, 3d, 4p, 5s, 4d, 5p, 6s, 4f, 5d, 6p, 7s, 5f, 6d, 7p
Atomic number 27:
1s2 2s2 2p6 3s2 3p6 4s2 3d7
Contains only 4 shells
Atomic number 36:
1s2 2s2 2p6 3s2 3p6 4s2 3d10 4p6
Also contains 4 shells...
Hope you understood..thank you