Boston - Granger, Cunningham, #23, #44, future Dallas 1st
Indiana - Marion, Carter, Crowder, #16
Dallas - Pierce
Dallas can then decide whether it wants to buy Pierce out to save money for free agency or keep him and Dirk together. Indiana gets a nice young player in Crowder, swaps firsts with Boston, and gets some quality veteran depth. Boston picks up a younger, though injured, version of Pierce who is also expiring, a young player in Cunningham, an extra second rounder, and a future pick (though that may convert to a second rounder as OKC owns the rights to Dallas' pick for awhile).
This obviously depends a great deal on how much Ainge likes Granger and what is health is like. I don't know the answer to that question, but Granger is just 30 so he would have a longer shelf life than Pierce.