Problem: Berland consists of n cities and m bidirectional roads connecting pairs of cities. There is no road connecting a city to itself, and between any pair of cities there is no more than one road. It is possible to reach any city from any other moving along roads.

Currently Mr. President is in the city s and his destination is the city t. He plans to move along roads from s to t (s ≠ t).

That's why Ministry of Fools and Roads has difficult days. The minister is afraid that Mr. President could get into a traffic jam or get lost. Who knows what else can happen!

To be sure that everything goes as planned, the minister decided to temporarily make all roads one-way. So each road will be oriented in one of two possible directions. The following conditions must be satisfied:

  * There should be no cycles along roads after orientation. 
  * The city s should be the only such city that all its roads are oriented out (i.e. there are no ingoing roads to the city s and the city s is the only such city). 
  * The city t should be the only such city that all its roads are oriented in (i.e. there are no outgoing roads from the city t and the city t is the only such city). 



Help the minister solve his problem. Write a program to find any such orientation of all roads or report that no solution exists.

Input

Each test in this problem contains one or more test cases to solve. The first line of the input contains positive number T — the number of cases to solve.

Each case starts with a line containing four integers n, m, s and t (2 ≤ n ≤ 4·105, 1 ≤ m ≤ 106, 1 ≤ s, t ≤ n, s ≠ t) — the number of cities, the number of roads and indices of departure and destination cities. The cities are numbered from 1 to n.

The following m lines contain roads, one road per line. Each road is given as two integer numbers xj, yj (1 ≤ xj, yj ≤ n, xj ≠ yj), which means that the j-th road connects cities xj and yj. There is at most one road between any pair of cities. It is possible to reach any city from any other moving along roads.

The sum of values n over all cases in a test doesn't exceed 4·105. The sum of values m over all cases in a test doesn't exceed 106.

Output

For each case print "Yes" if the answer exists. In the following m lines print roads in the required directions. You can print roads in arbitrary order. If there are multiple answers, print any of them.

Print the only line "No" if there is no answer for a case.

Example

Input

2
4 4 1 2
1 2
2 3
3 4
4 1
3 2 1 3
3 1
2 3


Output

Yes
1 2
3 2
4 3
1 4
No

Solution (in CPP):

Solution:
#include <bits/stdc++.h>
const int N = 400100;
const int M = 1001000;
struct T {
  int to, nxt;
} way[M << 1];
int n, m, s, t;
int h[N], num;
inline void link(int x, int y) {
  way[++num] = {y, h[x]}, h[x] = num;
  way[++num] = {x, h[y]}, h[y] = num;
}
int x[M], y[M], dir[M];
int fa[N], fa_edge[N], son[N], dep[N];
std::vector<int> edge[N];
inline void dfs0(int x, int fa, int fa_edge) {
  ::fa[x] = fa, ::fa_edge[x] = fa_edge, dep[x] = dep[fa] + 1;
  for (int i = h[x]; i; i = way[i].nxt)
    if (i ^ fa_edge ^ 1) {
      if (!dep[way[i].to]) {
        son[x] = way[i].to;
        dfs0(way[i].to, x, i);
      } else if (dep[way[i].to] < dep[x]) {
        edge[son[way[i].to]].push_back(i);
      }
    }
}
int main() {
  using std::cin;
  using std::cout;
  std::ios::sync_with_stdio(false), std::cin.tie(0);
  int T;
  cin >> T;
  for (; T--;) {
    cin >> n >> m >> s >> t;
    num = 1;
    for (int i = 1; i <= n; ++i) {
      h[i] = fa[i] = fa_edge[i] = son[i] = dep[i] = 0;
      edge[i].clear();
    }
    for (int i = 1; i <= m; ++i) {
      cin >> x[i] >> y[i];
      link(x[i], y[i]);
      dir[i] = -1;
    }
    dfs0(s, 0, 0);
    std::queue<std::pair<int, int> > q;
    q.emplace(t, 0);
    for (; !q.empty();) {
      std::pair<int, int> x = q.front();
      q.pop();
      int u = x.first, d = x.second;
      for (; u != s && dir[fa_edge[u] >> 1] == -1;) {
        dir[fa_edge[u] >> 1] = d;
        for (int i : edge[u]) {
          dir[i >> 1] = d;
          q.emplace(way[i ^ 1].to, d ^ 1);
        }
        u = fa[u];
      }
    }
    int have = 1;
    for (int i = 1; i <= m; ++i)
      if (dir[i] == -1) {
        have = 0;
        break;
      }
    if (!have) {
      cout << "No" << '\n';
    } else {
      cout << "Yes" << '\n';
      for (int i = 1; i <= m; ++i) {
        if ((dep[x[i]] > dep[y[i]]) ^ dir[i]) std::swap(x[i], y[i]);
        cout << x[i] << ' ' << y[i] << '\n';
      }
    }
  }
}