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;
bool debug = 0;
int n, m, k;
int dx[4] = {0, 1, 0, -1}, dy[4] = {1, 0, -1, 0};
string direc = "RDLU";
long long ln, lk, lm;
void etp(bool f = 0) {
  puts(f ? "Yes" : "No");
  exit(0);
}
void addmod(int &x, int y, int mod = 1000000007) {
  x += y;
  if (x >= mod) x -= mod;
  assert(x >= 0 && x < mod);
}
void et() {
  puts("-1");
  exit(0);
}
int s, t;
vector<int> mp[1000005];
int a[1000005], b[1000005];
int fa[1000005], child[1000005], dg[1000005];
vector<int> aux[1000005];
vector<pair<int, int> > ans;
bool vst[1000005];
void dfs(int x, int pa) {
  dg[x] = dg[pa] + 1;
  fa[x] = pa;
  child[pa] = x;
  for (int c : mp[x])
    if (c != pa) {
      if (dg[c] == 0)
        dfs(c, x);
      else {
        if (dg[c] < dg[x]) {
          aux[child[c]].push_back(x);
        }
      }
    }
}
void clr() {
  for (int(i) = 1; (i) <= (int)(n); (i)++) {
    fa[i] = 0;
    child[i] = 0;
    dg[i] = 0;
    aux[i].clear();
    vst[i] = 0;
    mp[i].clear();
  }
  ans.clear();
}
void fmain() {
  scanf("%d%d%d%d", &n, &m, &s, &t);
  for (int(i) = 1; (i) <= (int)(m); (i)++) {
    scanf("%d%d", a + i, b + i);
    mp[a[i]].push_back(b[i]);
    mp[b[i]].push_back(a[i]);
  }
  dfs(s, 0);
  queue<pair<int, int> > q;
  q.push({t, 1});
  while (!q.empty()) {
    auto x = q.front();
    q.pop();
    int v = x.first, dir = x.second;
    while (fa[v] != 0 && !vst[v]) {
      if (dir == 1)
        ans.push_back({fa[v], v});
      else
        ans.push_back({v, fa[v]});
      for (int pp : aux[v]) {
        if (dir == 1)
          ans.push_back({fa[v], pp});
        else
          ans.push_back({pp, fa[v]});
        q.push({pp, dir ^ 1});
      }
      vst[v] = 1;
      v = fa[v];
    }
  }
  if (ans.size() != m)
    puts("No");
  else {
    puts("Yes");
    for (auto p : ans) printf("%d %d\n", p.first, p.second);
  }
  clr();
}
int main() {
  int t = 1;
  scanf("%d", &t);
  for (int(i) = 1; (i) <= (int)(t); (i)++) {
    fmain();
  }
  return 0;
}