This story is from the Mahaprasthanika Parva which recites the journey of the Pandavas across India and finally their ascent towards Himalayas, as they climb their way to heaven on Mount Sumeru. As they leave their kingdom, a dog befriends them and joins their long journey. On their way, Draupadi dies first. Four of the Pandava brothers also die midway. Only Yudhishthira and the dog reaches Mount Sumeru. Their conversations, and reasons for not reaching heaven are described in Mahaprasthanika Parva.