Valmiki Ramayana Ayodhya Kanda Sarga 105 Shloka 28
Original Shlokaनात्र कश्चिद्यथाभावं प्राणी समभिवर्तते। तेन तस्मिन्न सामर्थ्यं प्रेतस्या स्त्यनुशोचतः।।2.105.28।।
1 source checked for this shloka
अत्र then in this world, कश्चित् प्राणी any living being, यथाभावम् as one likes, न समभिवर्तते does not go, तेन therefore, प्रेतस्य for the dead, अनुशोचतः for one who grieves, तस्मिन् in the matter of death, सामर्थ्यम् capability, नास्ति not there.
No living being in this world can act as he likes. Therefore, no one should grieve for the dead.