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;
const int N = 1e6 + 2;
char buf[(int)1e8], *ss = buf;
inline int readint() {
  int d = 0;
  while (!isdigit(*ss)) ++ss;
  while (isdigit(*ss)) d = d * 10 + (*ss++ & 15);
  return d;
}
int n, m, s, t, head[N], cnt, sta[N], top, fa[N], i_f[N], nson[N], dep[N];
int status[N];
vector<pair<int, int>> vG[N];
bool vis[N];
pair<int, int> Es[N];
struct edge {
  int to, nxt, id;
} e[N << 1];
void dfs(int now) {
  vis[now] = 1;
  for (int i = head[now]; i; i = e[i].nxt)
    if (!vis[e[i].to]) {
      nson[now] = e[i].to, fa[e[i].to] = now, i_f[e[i].to] = e[i].id;
      dep[e[i].to] = dep[now] + 1;
      dfs(e[i].to);
    } else if (i_f[now] != e[i].id && dep[e[i].to] < dep[now])
      vG[nson[e[i].to]].emplace_back(now, e[i].id);
}
int main() {
  buf[fread(buf, 1, (int)1e8 - 1, stdin)] = '\n', fclose(stdin);
  for (int T = readint(); T--;) {
    n = readint(), m = readint(), s = readint(), t = readint();
    for (int i = 1; i <= n; ++i) vis[i] = head[i] = 0, vG[i].clear();
    cnt = 0;
    for (int i = 1; i <= m; ++i) {
      int u = readint(), v = readint();
      Es[i] = make_pair(u, v);
      e[++cnt] = (edge){v, head[u], i}, head[u] = cnt;
      e[++cnt] = (edge){u, head[v], i}, head[v] = cnt;
    }
    fa[s] = i_f[s] = dep[s] = 0;
    dfs(s);
    for (int i = 1; i <= m; ++i) status[i] = -1;
    sta[top = 1] = t;
    status[i_f[t]] = 0;
    for (; top;) {
      int u = sta[top--];
      if (u == s) continue;
      int ns = status[i_f[u]];
      if (!~status[i_f[fa[u]]]) status[i_f[sta[++top] = fa[u]]] = ns;
      for (auto to : vG[u]) {
        status[to.second] = ns;
        if (!~status[i_f[to.first]]) status[i_f[sta[++top] = to.first]] = !ns;
      }
    }
    bool ok = 1;
    for (int i = 1; i <= m; ++i)
      if (status[i] == -1) ok = 0;
    if (ok) {
      puts("Yes");
      for (int i = 1; i <= m; ++i) {
        int u = Es[i].first, v = Es[i].second;
        if (dep[u] > dep[v]) u ^= v ^= u ^= v;
        if (status[i])
          printf("%d %d\n", v, u);
        else
          printf("%d %d\n", u, v);
      }
    } else
      puts("No");
  }
  return 0;
}