A massive multiple-input multiple-output (MIMO) system, which utilizes a large number of antennas at the base station (BS) to serve multiple users, suffers from pilot contamination due to inter-cell interference. A smart pilot assignment (SPA) scheme is proposed in this letter to improve the performance of users with severe pilot contamination. Specifically, by exploiting the large-scale characteristics of fading channels, the BS firstly measures the inter-cell interference of each pilot sequence caused by the users with the same pilot sequence in other adjacent cells. Then, in contrast to the conventional schemes which assign the pilot sequences to the users randomly, the proposed SPA method assigns the pilot sequence with the smallest inter-cell interference to the user having the worst channel quality in a sequential way to improve its performance. Simulation results verify the performance gain of the proposed scheme in typical massive MIMO systems.