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>
enum direction { U, D, undefined };
const int N = 400054, M = 2000054;
int V, E, Es, si, ti;
int to[M], first[N], next[M];
int p[N], pe[N], dep[N];
direction dir[M];
std::pair<int, direction> que[M];
std::vector<std::pair<int, int> > backwards[N];
inline direction operator-(const direction &x) { return x == U ? D : U; }
inline void addedge(int u, int v) {
  to[++Es] = v, next[Es] = first[u], first[u] = Es;
  to[++Es] = u, next[Es] = first[v], first[v] = Es;
}
int __cs[N];
void dfs(int x) {
  int i, y;
  for (i = first[x]; i; i = next[i])
    if (!~p[y = to[i]])
      __cs[x] = y, p[y] = x, dep[y] = dep[x] + 1, pe[y] = i, dfs(y);
    else if (y != p[x] && dep[y] < dep[x])
      backwards[__cs[y]].emplace_back(x, i);
}
void work() {
  int i, u, v, h, t = 1;
  direction du;
  scanf("%d%d%d%d", &V, &E, &si, &ti), Es = 0;
  memset(first, 0, (V + 1) << 2);
  memset(p, -1, (V + 1) << 2);
  for (i = 1; i <= V; ++i) backwards[i].clear();
  for (i = 0; i < E; ++i) scanf("%d%d", &u, &v), addedge(u, v);
  p[si] = pe[si] = dep[si] = 0, dfs(si);
  dfs(si);
  for (i = 1; i <= Es; ++i) dir[i] = undefined;
  *que = std::pair<int, direction>(ti, D);
  for (h = 0; h < t; ++h) {
    std::tie(u, du) = que[h];
    for (; u != si && dir[pe[u]] == undefined; u = p[u]) {
      dir[((((pe[u]) - 1) ^ 1) + 1)] = dir[pe[u]] = du;
      for (const std::pair<int, int> &e : backwards[u])
        std::tie(v, i) = e, dir[((((i)-1) ^ 1) + 1)] = dir[i] = du,
                    que[t++] = std::pair<int, direction>(v, -du);
    }
  }
  if (std::count(dir + 1, dir + (Es + 1), undefined))
    puts("No");
  else
    for (puts("Yes"), i = 1; i <= Es; i += 2)
      u = to[i + 1], v = to[i],
      ((dir[i] == D) ^ (dep[u] < dep[v])) && (std::swap(u, v), 0),
      printf("%d %d\n", u, v);
}
int main() {
  int T;
  for (scanf("%d", &T); T; --T) work();
  return 0;
}