Mallikā
Mallikā Sutta  (SN 3:8)

This sutta is nearly identical with Ud 5:1.

Near Sāvatthī. On that occasion King Pasenadi Kosala had gone with Queen Mallikā to the upper palace. Then he said to her, “Mallikā, is there anyone dearer to you than yourself?”

“No, great king. There is no one dearer to me than myself. And what about you, great king? Is there anyone dearer to you than yourself?”

“No, Mallikā. There is no one dearer to me than myself.”

Then the king, descending from the palace, went to the Blessed One and, on arrival, having bowed down to him, sat to one side. As he was sitting there, he said to the Blessed One, “Just now, lord, when I had gone with Queen Mallikā to the upper palace, I said to her, ‘Mallikā, is there anyone dearer to you than yourself?’

“When this was said, she said to me, ‘No, great king. There is no one dearer to me than myself. And what about you, great king? Is there anyone dearer to you than yourself?’

“When this was said, I said to her, ‘No, Mallikā. There is no one dearer to me than myself.’”

Then, on realizing the significance of that, the Blessed One at that time said this verse:

“Searching all directions

with your awareness,

you find no one dearer

than yourself.

In the same way, others

are thickly dear to themselves.

So you shouldn’t hurt others

if you love yourself.”

See also: MN 87; Ud 2:3; Ud 5:4