AIB agrees deals for mortgage write-offs