Leaving a legacy: Intergenerational allocations of benefits and burdens