Pain as the price tag of memory