Office Depot to buy rival OfficeMax