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;
long long gcd(long long a, long long b) { return b == 0 ? a : gcd(b, a % b); }
const int MAXN = 400000;
const int MAXM = 1000000;
const int MAXNM = MAXN > MAXM ? MAXN : MAXM;
int n, m, s, t;
int ghead[MAXN], gnxt[2 * MAXM], gto[2 * MAXM];
int par[MAXN], parx[MAXN];
int lst[MAXN], nlst;
int id[MAXN], nid;
int path[MAXN], npath;
int ehead[MAXN], enxt[2 * MAXM], pnxt[2 * MAXM], etail[2 * MAXM];
bool visit[MAXN];
int stck[MAXN], nstck;
int val[MAXN], nval;
int thead[MAXN];
void dfs(int at) {
  lst[nlst++] = at, id[at] = nid++;
  for (int x = ghead[at]; x != -1; x = gnxt[x]) {
    int to = gto[x];
    if (par[to] != -2) continue;
    par[to] = at, parx[to] = x ^ 1;
    dfs(to);
  }
}
bool solve() {
  for (int i = (0); i < (n); ++i)
    if (i != s && i != t && (ghead[i] == -1 || gnxt[ghead[i]] == -1))
      return false;
  for (int i = (0); i < (n); ++i) par[i] = -2;
  par[s] = -1;
  nlst = nid = 0;
  dfs(s);
  for (int i = (0); i < (n); ++i) visit[i] = false, ehead[i] = -1;
  for (int cur = t; cur != -1; cur = par[cur]) visit[cur] = true;
  for (int i = (0); i < (n); ++i) {
    int at = lst[i];
    for (int x = ghead[at]; x != -1; x = gnxt[x]) {
      int to = gto[x];
      if (par[to] == at || to == par[at] || id[to] <= id[at]) continue;
      npath = 0;
      path[npath++] = x;
      visit[at] = true;
      for (int cur = to; !visit[cur]; visit[cur] = true, cur = par[cur])
        path[npath++] = parx[cur];
      if (gto[path[npath - 1]] == at) return false;
      enxt[path[0]] = ehead[at];
      ehead[at] = path[0];
      etail[path[0]] = gto[path[npath - 1]];
      for (int j = (0); j < (npath); ++j)
        pnxt[path[j]] = j + 1 < npath ? path[j + 1] : -1;
      enxt[path[npath - 1] ^ 1] = ehead[gto[path[npath - 1]]];
      ehead[gto[path[npath - 1]]] = path[npath - 1] ^ 1;
      etail[path[npath - 1] ^ 1] = at;
      for (int j = (0); j < (npath); ++j)
        pnxt[path[j] ^ 1] = j - 1 >= 0 ? (path[j - 1] ^ 1) : -1;
    }
  }
  nstck = 0;
  for (int cur = t; cur != -1; cur = par[cur]) stck[nstck++] = cur;
  for (int i = (0); i < (n); ++i) val[i] = -1, thead[i] = ehead[i];
  nval = 0;
  while (nstck > 0) {
    int at = stck[nstck - 1];
    if (val[at] == -1) {
      val[at] = nval++;
    }
    bool found = false;
    for (int x = thead[at]; !found && x != -1; x = thead[at] = enxt[x]) {
      if (val[etail[x]] != -1) continue;
      npath = 0;
      for (int y = x; y != -1; y = pnxt[y]) path[npath++] = gto[y];
      for (int i = npath - 2; i >= 0; --i) stck[nstck++] = path[i];
      found = true;
    }
    if (!found) --nstck;
  }
  return true;
}
int ncases;
void run(int casenr) {
  scanf("%d%d%d%d", &n, &m, &s, &t);
  --s, --t;
  for (int i = (0); i < (n); ++i) ghead[i] = -1;
  for (int i = (0); i < (m); ++i) {
    int a, b;
    scanf("%d%d", &a, &b);
    --a, --b;
    gnxt[2 * i + 0] = ghead[a];
    ghead[a] = 2 * i + 0;
    gto[2 * i + 0] = b;
    gnxt[2 * i + 1] = ghead[b];
    ghead[b] = 2 * i + 1;
    gto[2 * i + 1] = a;
  }
  if (!solve()) {
    printf("No\n");
    return;
  }
  printf("Yes\n");
  for (int i = (0); i < (m); ++i) {
    int a = gto[2 * i + 1], b = gto[2 * i + 0];
    if (val[a] > val[b]) swap(a, b);
    printf("%d %d\n", a + 1, b + 1);
  }
}
int main() {
  scanf("%d", &ncases);
  for (int i = (1); i <= (ncases); ++i) run(i);
  return 0;
}