Sophia of Masovia
Sophia of Masovia( 1497/1498- before 11 March 1543) was a Princess of Masovia, daughter of Konrad III Rudy, Duke of Masovia and his wife Anna Radziwiłł.
She was a member of the House of Piast.
On 17 September 1520 in Warsaw, Sophia was married by proxy to Stephen VII Báthory.
On 17 January 1521, Sophia and her entourage went to Hungary, where in February there was a formal marriage.
The couple had three children:
Anna, Stephen and Klara; however, other sources claim that Klara was the couple's only child.
Klara was engaged to Carl, Duke of Münsterberg, but died in 1535, before the marriage took place.
After the death of Stephen in 1530, Sophia was married to Croatian magnate Louis Pekry.
Sophia's second marriage was childless.
She then died sometime before 11 March 1543.
Sophia had three siblings: Stanislaus I of Masovia, Janusz III of Masovia and Anna of Masovia, both her brothers died childless and so Anna and Sophia were the last Masovian Piasts.
Soon after Janusz's death, the Duchy of Masovia was annexed into the kingdom of Poland, despite resistance from some of the Masovian nobility.
They tried to retain their independence and argued that the Duchy should be inherited by the female relatives( such as Anna or Sophia).
The Polish king refused to recognize their demands.
Anna was made titular Duchess of Masovia.
Konrad II of Masovia
Konrad II of Czersk( pl:" Konrad II czerski"; c. 1250 – 24 June/ 21 October 1294), was a Polish prince member of the House of Piast, Duke of Masovia during 1264- 1275 jointly with his brother, since 1275 sole ruler over Czersk and Duke of Sandomierz during 1289.
He was the eldest son of Siemowit I of Masovia and Pereyaslava, a daughter of Prince Daniel of Halych.
Siemowit III, Duke of Masovia
Siemowit III of Masovia( his name also rendered Ziemowit; – 1381) was a prince of Masovia and a co-regent( with his brother Casimir I of Warsaw) of the lands of Warsaw, Czersk, Rawa, Gostynin and other parts of Masovia.
Siemowit VI of Płock
Siemowit VI of Płock (pl: "Siemowit VI płocki"; 2 January 1446 - 31 December 1461/1 January 1462), was a Polish prince member of the House of Piast from the Masovian branch.
He was a Duke of Płock, Rawa Mazowiecka, Belz, Płońsk, Zawkrze and Wizna during 1455-1461/62 (under regency until 1459) jointly with his brother, since 1459 ruler over Gostynin.
He was the eldest son of Władysław I of Płock and Anna, daughter of Duke Konrad V of Oleśnica.
Anna of Masovia
Anna of Masovia( c. 1498 – after 26 January 1557 in Jaroslaw) was Princess of Mazovia and a member of the House of Piast.
She was the last representative of the line of Masovian- Piast.
She was the second daughter of Konrad III of Masovia and Anna Radziwiłł.
She was a sister of Dukes Janusz III of Masovia and Stanislaus of Masovia, and Sophia, who married Stephen VII Báthory.
Margaret of Masovia
Margaret of Masovia( before 1358 – 14 May 1388/4 April 1396) was Duchess of Pomerania and Brzeg, by her marriages to Casimir IV, Duke of Pomerania and then to Henryk VIII with a Scar.
She was a member of the House of Piast.
Margaret was a daughter of Siemowit III of Masovia and his wife Euphemia of Opawa.
Her paternal grandparents were Trojden I of Masovia and his wife Maria, daughter of Yuri I of Galicia and Euphemia of Kuyavia.
Władysław I of Płock
Władysław I of Płock (pl: "
Władysław I płocki"; 1406/09 - 11/12 December 1455), was a Polish prince member of the House of Piast from the Masovian branch.
He was a Duke of Płock, Rawa Mazowiecka, Gostynin, Sochaczew, Belz, Płońsk, Zawkrze and Wizna during 1426-1434 jointly with his brothers, after the division of the paternal inheritance between him and his brothers in 1434, sole ruler over Płock, Płońsk, Wizna and Zawkrze; in 1442 he reunited all their patrimony (except Gostynin).
He was the fifth son of Siemowit IV, Duke of Masovia and Alexandra of Lithuania, daughter of Algirdas.
Hedwig of Masovia
Hedwig of Masovia( ca. 1392 – after 19 February 1439), was a Polish princess, member of the House of Piast in the Masovian branch.
She was the eldest daughter of Siemowit IV, Duke of Masovia and Alexandra, a daughter of Algirdas, Grand Duke of Lithuania and sister of King Władysław II Jagiełło of Poland.
Amelia of Masovia
Amelia of Masovia( pl:" Amelia mazowiecka"; 1397/98- after 17 May 1434), was a Polish princess member of the House of Piast in the Masovian branch.
She was the fourth daughter of Siemowit IV, Duke of Masovia and Alexandra, a daughter of Algirdas, Grand Duke of Lithuania and sister of King Władysław II Jagiełło of Poland.
Catherine of Masovia
Catherine of Masovia( pl:" Katarzyna mazowiecka"; 1413/16 – betw.
2 June 1479/5 July 1480) was a Polish princess member of the House of Piast in the Masovian branch.
She was the eighth and youngest daughter of Siemowit IV, Duke of Masovia and Alexandra, a daughter of Algirdas, Grand Duke of Lithuania and sister of King Władysław II Jagiełło of Poland.

Question: Who is Siemowit Vi Of Płock's paternal grandfather?
Answer: Siemowit IV