Just pulled it up out of curiosity. Ultimately, it’s Aegon III Targaryen, who is on the throne.
It goes Viserys, who is Rhaenyra’s dad. Then, his son Aegon II (via Alicent Hightower) takes the throne. This causes the whole war between the blacks and the greens.
When he dies, Rhaenyra’s son Aegon III takes the throne. So I guess Rhaenyra technically wins the war, even though she is never queen.
Through his line we eventually get to Aerys II, the Mad King.