Djamila said:
Imagine you were madly in love with a man or woman who died. Maybe it was after 25 years of marriage, maybe it was after a few special dates.
Now years later, you fall in love again, and you spend the rest of your life with this new person.
When all three of you are dead and, imagine, in heaven, what happens?
Your question remotely reminds me of a passage in Scripture where the Sadducees asked Jesus something somewhat similar:
"The same day the Sadducees, who say there is no resurrection, came to Him (Jesus) and asked Him, saying, 'Teacher, Moses said that if a man dies, having no children, his brother shall marry his wife and raise up offspring for his brother. Now there were with us seven brothers. The first had died after he had married, and having no offspring, left his wife to his brother. Likewise the second also, and the third, even to the seventh. Last of all the woman died also. Therefore, in the resurrection, whose wife of the seven will she be? For they all had her.' Jesus answered and said to them, 'You are mistaken, not knowing the Scriptures nor the power of God. For in the resurrection they neither marry nor are given in marraige, but are like the angels of God in heaven.' " Matthew 22:23-30
FGS