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>
int lst[400005], to[2000005], pre[2000005], tot;
int dir[400005], fa[400005], fae[400005], que[400005];
int node[400005], dep[400005], son[400005];
std::vector<int> cyc[400005];
bool vis[400005];
inline void add_edge(int u, int v) {
  to[tot] = v;
  pre[tot] = lst[u];
  lst[u] = tot++;
}
void dfs(int u, int f = -1) {
  fa[u] = f;
  for (int i = lst[u]; ~i; i = pre[i]) {
    if (~f && i == (fae[u] ^ 1)) continue;
    int v = to[i];
    if (!dep[v]) {
      son[u] = v;
      fae[v] = i;
      dep[v] = dep[u] + 1;
      dfs(v, u);
    } else if (dep[v] < dep[u])
      cyc[son[v]].push_back(i);
  }
}
void solve(int n, int m, int s, int t) {
  memset(vis, false, n);
  memset(lst, -1, n << 2);
  memset(dir, -1, m << 2);
  memset(dep, 0, n << 2);
  tot = 0;
  for (int i = 0; i < n; i++) cyc[i].clear();
  for (int i = 0; i < m; i++) {
    int u, v;
    scanf("%d%d", &u, &v);
    add_edge(--u, --v);
    add_edge(v, u);
  }
  dep[s] = 1;
  dfs(s);
  if (!dep[t]) {
    puts("No");
    return;
  }
  int he = 0, ta = 0;
  vis[t] = true;
  que[ta++] = t;
  while (he < ta) {
    int x = que[he++], u = x < 0 ? ~x : x, d = x < 0 ? 1 : 0;
    dir[fae[u] >> 1] = d;
    for (auto e : cyc[u]) {
      int v = to[e] ^ to[e ^ 1] ^ fa[u];
      dir[e >> 1] = d;
      if (!vis[v]) {
        vis[v] = true;
        que[ta++] = d ? v : ~v;
      }
    }
    if (fa[u] != s && !vis[fa[u]]) {
      vis[fa[u]] = true;
      que[ta++] = d ? ~fa[u] : fa[u];
    }
  }
  for (int i = 0; i < m; i++) {
    if (-1 == dir[i]) {
      puts("No");
      return;
    }
  }
  puts("Yes");
  for (int i = 0; i < m; i++) {
    if (dir[i] ^ (dep[to[i << 1]] > dep[to[i << 1 | 1]]))
      printf("%d %d\n", to[i << 1 | 1] + 1, to[i << 1] + 1);
    else
      printf("%d %d\n", to[i << 1] + 1, to[i << 1 | 1] + 1);
  }
}
int main() {
  int cas;
  scanf("%d", &cas);
  while (cas--) {
    int n, m, s, t;
    scanf("%d%d%d%d", &n, &m, &s, &t);
    solve(n, m, --s, --t);
  }
  return 0;
}