Section 3. A person whose name is not printed on a state primary ballot as a candidate for an office, but who receives sufficient votes to nominate him therefor, shall, not later than five o’clock post meridian of the thirteenth day after a regular state primary and the sixth day after a special state primary, file in the office of the state secretary a written acceptance of said nomination and a receipt from the state ethics commission verifying the fact that a statement of financial interest has been filed under chapter two hundred and sixty-eight B. A person whose name is not printed on a city or town primary ballot, but who receives sufficient votes to nominate him, shall, within six days from the aforementioned time and day, file a written acceptance of said nomination in the office of the city or town clerk. The name of any such person who fails to file such written acceptance, and such receipt if required, shall not be printed on the official ballot to be used at the ensuing election. When such acceptance has been filed, it may not thereafter be withdrawn. This section shall be construed to provide that written acceptance of such a nomination at a primary shall be filed as aforesaid within the time herein limited, by any such person whose nomination is finally determined after the expiration of the time so limited, otherwise his name shall not be printed on the ballot at the ensuing election.