Too sensitive GameObjects

I am instantiating some cubes one over the other, a number of cubes from 3 to 300. At the game starts the cubes instantiate correctly, but because the gravity thay fall, how can I not change the x and z axes and the rotation of my cubes so that they remain stuck? however, when I go on I will have to move them from the script


This is the script that instantiates them

This is what should not happen.
The poles (gray ones) are not solid, they are only for beauty

under rigidbody inspector find constrain and freeze position and rotation