How to calculate non Massachusetts portion of income and non Massachusetts portion of deductions?

They asked me to enter the non Massachusetts portion of the amount I paid during 2021 to social security, railroad, Medicare, U.S or MA retirement.