Cooling simulations of neutron stars (NSs) are performed assuming that stel
lar cores consist of neutrons, protons and electrons and using realistic de
nsity profiles of superfluid critical temperatures T-cn(rho) and T-cp(rho)
of neutrons and protons. Taking a suitable profile of T-cp(rho) with maximu
m similar to5 x 10(9) K one can obtain smooth transition from slow to rapid
cooling with increasing stellar mass. Adopting the same profile one can ex
plain the majority of observations of thermal emission from isolated middle
-aged NSs by cooling of NSs with different masses either with no neutron su
perfluidity in the cores or with a weak superfluidity, T-cn < 10(8) K. The
required masses range from <similar to>1:2 M-. for (young and hot) RX J0822
-43 and (old and warm) PSR 1055-52 and RX J1856-3754 to approximate to1:45
M-. for the (rather cold) Geminga and Vela pulsars. Observations constrain
the T-cn(rho) andT(cp)(rho) profiles with respect to the threshold density
of direct Urca process and maximum central density of NSs.