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 xn = 400001, xm = 1000001, xe = 2000001;
int head[xn], next[xe], to[xe], N, E, dir[xm], q[xn], ue[xn], vi[xn], left[xn],
    right[xn], D, M, START, END, J[19][xn],
    *fa = J[0], fe[xn], flag[xn], dep[xn], L, stack[xn], searched[xn], LOG;
std::vector<int> V[xn];
int I() {
  char c = getchar();
  int r = 0;
  while (c < 48 || c > 57) c = getchar();
  while (c > 47 && c < 58) {
    r = (r << 3) + r + r + c - 48;
    c = getchar();
  }
  return r;
}
inline void add(int u, int v) {
  next[++E] = head[u], to[E] = v, head[u] = E;
  next[++E] = head[v], to[E] = u, head[v] = E;
}
int up(int x, int y) {
  for (int i = LOG; ~i; i--)
    if (y >> i & 1) x = J[i][x];
  return x;
}
int main() {
  for (int TC = I(); TC--;) {
    N = I(), M = I(), START = I(), END = I();
    E = 0;
    for (int i = 1; i <= N; i++) searched[i] = head[i] = vi[i] = flag[i] = 0;
    for (int i = 1; i <= M; i++) {
      add(I(), I());
      dir[i] = 0;
    }
    q[1] = END, ue[1] = head[END], vi[END] = 1;
    fa[END] = fe[END] = dep[END] = 0;
    int TIME = 1;
    left[END] = right[END] = 1;
    D = 1;
    while (D) {
      while (ue[D] && vi[to[ue[D]]]) ue[D] = next[ue[D]];
      if (ue[D]) {
        int To = to[ue[D]], Ue = ue[D];
        ue[D] = next[ue[D]];
        fa[To] = q[D], vi[To] = 1, fe[To] = Ue + 1 >> 1, dep[To] = D;
        left[To] = right[To] = ++TIME;
        q[++D] = To, ue[D] = head[To];
      } else {
        if (D > 1) right[q[D - 1]] = right[q[D]];
        D--;
      }
    }
    stack[L = 1] = START, flag[START] = 1;
    LOG = 0;
    while (2 << LOG < N) LOG++;
    for (int i = 1; i <= LOG; i++)
      for (int j = 1; j <= N; j++) J[i][j] = J[i - 1][J[i - 1][j]];
    for (int i = 1; i <= N; i++) V[i].clear();
    for (int i = 1; i <= N; i++)
      for (int e = head[i]; e; e = next[e])
        if (dep[to[e]] - dep[i] > 1)
          V[up(to[e], dep[to[e]] - dep[i] - 1)].push_back(e);
    while (L) {
      int u = stack[L--], F = flag[u], LE = left[u], RI = right[u];
      dir[fe[u]] = F;
      if (!searched[u]) {
        searched[u] = 1;
        for (std::vector<int>::iterator j = V[u].begin(); j != V[u].end();
             j++) {
          dir[*j + 1 >> 1] = F;
          if (!flag[to[*j]]) flag[to[*j]] = -F, stack[++L] = to[*j];
        }
        u = fa[u];
      } else
        u = fa[u];
      if (u != END && !flag[u]) flag[u] = F, stack[++L] = u;
    }
    bool valid = 1;
    for (int i = 1; valid && i <= M; i++)
      if (!dir[i]) valid = 0;
    if (valid) {
      puts("Yes");
      for (int i = 1; i <= M; i++) {
        int u = to[i + i - 1], v = to[i + i], tmp;
        if ((dep[u] < dep[v]) ^ (dir[i] == -1)) tmp = u, u = v, v = tmp;
        printf("%d %d\n", u, v);
      }
    } else
      puts("No");
  }
  return 0;
}