Study of resonances in exclusive B decays to D¯(*)D(*)K