Answer
Ferdinand VI of Spain was the nephew of Ferdinand I. Ferdinand I, Holy Roman Emperor, was the younger brother of Charles V and succeeded him as Holy Roman Emperor and Archduke of Austria. He was also King of Hungary and Bohemia. His son, Maximilian II, became Holy Roman Emperor after him, and Maximilian II's son became Emperor Rudolf II.