Pilot reuse in the multi-cell massive multi-input multi-output system is investigated where user groups with different priorities exist. Recent investigation on pilot reuse has revealed that when the ratio of the coherent time interval to the number of users is reasonably high, it is beneficial not to fully reuse pilots from interfering cells. This paper finds the optimum pilot assignment strategy that would maximize the weighted sum rate (WSR) given the user groups with different priorities. A closed-form solution for the optimal pilot assignment is derived and is shown to make intuitive sense. Performance comparison shows that under wide range of channel conditions, the optimal pilot assignment that uses extra set of pilots achieves better WSR performance than conventional full pilot reuse.