Late-night riders of the N, Q and R trains in Manhattan will have to plan ahead.

The MTA will conduct Fastrack repairs from 10 p.m. to 5 a.m., Monday night to Friday morning, allowing crews to maintain the tracks.

N trains will operate between Ditmars Boulevard and Queensboro Plaza in Queens and Stillwell Avenue and Court Street in Brooklyn. The Q train will be rerouted over the D line between the 57th Street station and Dekalb Avenue. Shuttle buses will replace the R train between 36th and 95th streets.