From what I remember (vaguely) it should be the primary structure. Maybe because when you denature a protein, you loose secondary, and tertiary structure but not the primary. Therefore, primary structure posses all the info needed to fold the protein.
*Hope this helps!