Allocating K-1 income for part-year resident

Taxpayer lived in MA from Jan-Aug, and then in PA from Sep-Dec. They are a shareholder in an S-Corp that they did not materially participate in. As such they received a K-1 (and PA NRK-1) with $1,300 of OBI from a PA S-Corp.

How should the taxpayer's income be reported to MA and to PA?