Ram was the father of Amminadab. Amminadab was the father of Nahshon. Nahshon was the father of Salmon.
David was the son of Jesse. Jesse was the son of Obed. Obed was the son of Boaz. Boaz was the son of Salmon. Salmon was the son of Nahshon.
Judah was the father of Perez and Zerah, and Tamar was their mother. Perez was the father of Hezron. Hezron was the father of Ram.
Salmon was the father of Boaz, and Rahab was his mother. Boaz was the father of Obed, and Ruth was his mother. Obed was the father of Jesse.