The owner or general agent of a building or premises where a violation of any provision of said regulations has been committed or shall exist, or the lessee or tenant of an entire building or entire premises where such violation has been committed or shall exist, or the owner, general agent, lessee, or tenant of any part of the building or premises in which such violation has been committed or shall exist, or the general agent, architect, builder, contractor, or any other person who commits, takes part or assists in any such violation, or who maintains any building or premises in which any such violation shall exist shall be guilty of a misdemeanor punishable as follows: by a fine of not less than $10 and not more than $250 for each and every day that such violation continues, or by imprisonment for 10 days for each and every day such violation shall continue, or by both such fine and imprisonment in the discretion of the court. For the second and subsequent offenses involving the same violation at the same building or premises, the punishment shall be a fine of not less than $100 nor more than $500 for each and every day that such violation shall continue, or imprisonment for 10 days for each and every day such violation shall continue, or both such fine and imprisonment in the discretion of the court.