Multiparticle azimuthal correlations in pPb and PbPb collisions at the CERN LHC