Code-Cola Plants

아직 제출이 없습니다시간 제한4초메모리 제한512 MB

문제

Berland consists of nn cities which are numbered by integers from 11 to nn. There are mm directed roads connecting some pairs of cities. There is no directed cycle of roads in Berland.

There are two Code-Cola plants in Berland. The first one is a producing plant, it is located in the city aa. The second one is a recycling plant, it is located in the city bb.

The Code-Cola Corporation decided to use n1n-1 roads for delivery. Using this set of roads, it must be possible to reach all of the nn cities from the production plant (that is, from the city aa). Also the Code-Cola Corporation decided to use some other n1n-1 roads by recycling trucks which will deliver empty Code-Cola bottles to the recycling plant. Using this second set of roads, it must be possible to reach the recycling plant (that is, the city bb) from all of the nn cities.

Help the Code-Cola Corporation to find two disjoint sets of roads such that:

  • each of the two sets contains n1n-1 roads;
  • it is possible to get to any city from the city aa by moving along the first set of roads;
  • it is possible to get from any city to the city bb by moving along the second set of roads.

입력

The input contains one or more test cases. The input format for each test case is described below.

Each test case starts with a line containing four integers: nn, the number of cities in Berland, mm, the number of roads, aa, the city with the producing plant, and bb, the city with the recycling plant (2n51052 \le n \le 5 \cdot 10^5, 1m1061 \le m \le 10^6, 1a,bn1 \le a, b \le n). It is possible that a=ba = b.

The following mm lines contain descriptions of the roads, one description per line. The ii-th description consists of two integers x_ix\_i and y_iy\_i meaning that there is a directed (one-way) road from x_ix\_i to y_iy\_i (1x_i,y_in1 \le x\_i, y\_i \le n). It is guaranteed that there is no directed cycle of roads in Berland. Between a pair of cities, there can be multiple roads in the same direction.

The sum of all values of nn over all test cases in a test does not exceed 51055 \cdot 10^5. The sum of all values of mm over all test cases in a test does not exceed 10610^6. The test cases just follow one another without any special separators.

출력

For each test case, print the answer as follows:

If there is a solution, print "YES" on a separate line, followed by two lines containing n1n-1 road indices each. The first line must describe the roads from the first set, the second line must describe the roads from the second set. All 2(n1)2 \cdot (n-1) indices must be distinct. The roads are numbered from 11 to mm in order of their appearance in the input. You can print numbers on a line in any order. If there are several possible solutions, print any one of them.

If there is no solution, print "NO" on a separate line.