We analyze the relative yields of different bottomonia and charmonia states produced in Pb-Pb, p-Pb and high multiplicity p-p collisions at LHC, within a semi-classical grand canonical ensemble approach. The underlying assumption is the early thermalization and subsequent freezeout of these heavy hadrons resulting in their chemical freezeout at a temperature of approximately 230 MeV, significantly higher than that of light and strange hadrons. The systematic dependence of the freezeout temperature on the collision centrality is also investigated in details.