Massachusetts 401K deductions

Tax regulations in Massachusetts allow 401K contributions to be deducted from

Massachusetts taxable income.  How does this work, when the state form is

generated along with the Federal?  Thank you.