The first line contains an integer n, the number of vertices of the polygon (4≤n≤50000).
Each of the next n−3 lines contains two integers ai and bi, the endpoints of the i-th diagonal (1≤ai,bi≤n, ai=bi).
The next line contains an integer q, the number of queries (1≤q≤100000).
Each of the next q lines contains two integers xi and yi, the two vertices of the i-th query (1≤xi,yi≤n).
No diagonal coincides with a side of the polygon, and no two diagonals coincide or cross.