Ruby is the Minister of Railways of Code-Land. She has been given a map of the train routes between N stations (S1 S2 S3 ... SN). The map contains information about all the direct routes that exits between a pair of stations, and there exists at most one outgoing route from any station Sj. If a route exists between stations Sj and Sk, then the train can only travel from Sj to Sk.
Ruby has decided to improve the railway channel and accepts Q queries based on administrative evaluation.
INPUT FORMAT :
OUTPUT FORMAT :
Constraints: