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>
using namespace std;
#pragma comment(linker, "/STACK:1024000000,1024000000")
long long powmod(long long a, long long b) {
  long long res = 1;
  a %= 1000000007;
  for (; b; b >>= 1) {
    if (b & 1) res = res * a % 1000000007;
    a = a * a % 1000000007;
  }
  return res;
}
int gcd(int x, int y) {
  while (y) {
    int t = x % y;
    x = y;
    y = t;
  }
  return x;
}
int vis[2000010], fst[2000010], nxt[2000100], vv[2000100], id[2000100], e;
int fa[2000010], dep[2000010], fae[2000010];
int n, m, s, t;
int dir[2000100], su[2000100], sv[2000100], son[2000010];
int fst1[2000010], nxt1[2000100], vv1[2000100], id1[2000100], e1;
void init() {
  e1 = e = 0;
  for (int i = 1; i <= n; i++) fst[i] = fst1[i] = -1, vis[i] = 0;
  for (int i = 1; i <= m; i++) dir[i] = -1;
}
void add(int u, int v, int i) {
  vv[e] = v, nxt[e] = fst[u], id[e] = i, fst[u] = e++;
  vv[e] = u, nxt[e] = fst[v], id[e] = i, fst[v] = e++;
}
void add1(int u, int v, int i) {
  vv1[e1] = v, nxt1[e1] = fst1[u], id1[e1] = i, fst1[u] = e1++;
}
void dfs(int u) {
  vis[u] = 1;
  for (int i = fst[u]; ~i; i = nxt[i]) {
    int v = vv[i];
    if (v == fa[u]) continue;
    if (!vis[v]) {
      fae[v] = id[i];
      dep[v] = dep[u] + 1;
      fa[v] = u;
      son[u] = v;
      dfs(v);
    } else if (dep[v] < dep[u]) {
      add1(son[v], u, id[i]);
    }
  }
}
int main() {
  int T;
  scanf("%d", &T);
  while (T--) {
    scanf("%d%d%d%d", &n, &m, &s, &t);
    init();
    for (int i = 1; i <= m; i++) {
      scanf("%d%d", &su[i], &sv[i]);
      add(su[i], sv[i], i);
    }
    fa[s] = dep[s] = 0;
    dfs(s);
    queue<pair<int, int> > que;
    que.push(make_pair(t, 0));
    while (!que.empty()) {
      int u(que.front().first), d(que.front().second);
      que.pop();
      while (fa[u] && dir[fae[u]] == -1) {
        dir[fae[u]] = d;
        for (int i = fst1[u]; ~i; i = nxt1[i]) {
          int v = vv1[i];
          dir[id1[i]] = d;
          que.push(make_pair(v, d ^ 1));
        }
        u = fa[u];
      }
    }
    int flag = 0;
    for (int i = 1; i <= m; i++)
      if (dir[i] == -1) {
        flag = 1;
        break;
      }
    if (flag)
      puts("No");
    else {
      puts("Yes");
      for (int i = 1; i <= m; i++) {
        if ((dep[su[i]] < dep[sv[i]]) == dir[i]) swap(su[i], sv[i]);
        printf("%d %d\n", su[i], sv[i]);
      }
    }
  }
  return 0;
}