ccentralized printing function