In Editor, I want to Instantiate gameobjects and save the result in a prefab

I want to Instantiate gameobjects in the editor, and save the result as a prefab.
My problem is that when I instantiate, all the clones are at the root in the hierarchy.

I would like to have this

etc…

And after that I want to save the Mygameobject hierarchy into a prefab.

Anyone knows how I can ‘move’ a gameobject inside another one like you move a file in a folder?
(note: I know how to do it with the mouse! I want to do it programatically)

You can change the parent variable of the gameObjects transformation:

Script:

Or Editor:

Now your clone is the child of an other gameobject.

It works! Thanks for the tip.