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 MAXN = 400005;
const int MAXM = 1000005;
inline int read() {
  int x = 0, f = 1;
  char ch = getchar();
  while (ch < '0' || ch > '9') {
    if (ch == '-') f = -1;
    ch = getchar();
  }
  while (ch >= '0' && ch <= '9') {
    x = x * 10 + ch - '0';
    ch = getchar();
  }
  return x * f;
}
struct Edge {
  int from, to, dii;
  Edge() {}
  Edge(int a, int b, int c = -1) : from(a), to(b), dii(c) {}
};
int T, n, m, s, t;
vector<Edge> edges;
vector<int> G[MAXN];
int deep[MAXN], fae[MAXN];
vector<int> rejs[MAXN];
bool vis[MAXN];
int lnk[MAXN];
void bfs() {
  for (int i = 1; i <= n; i++) vis[i] = 0;
  static queue<pair<int, int> > q;
  q.push(make_pair(t, 1));
  vis[t] = 1;
  while (!q.empty()) {
    pair<int, int> cur = q.front();
    q.pop();
    int x = cur.first;
    int dir = cur.second;
    edges[fae[x]].dii = dir;
    int nex = edges[fae[x]].from;
    for (int i = 0; i < rejs[x].size(); i++) {
      Edge &e = edges[rejs[x][i]];
      e.dii = dir;
      if (!vis[e.to]) {
        vis[e.to] = 1;
        q.push(make_pair(e.to, dir ^ 1));
      }
    }
    if (nex != s && !vis[nex]) {
      vis[nex] = 1;
      q.push(make_pair(nex, dir));
    }
  }
}
void dfs(int x, int pre) {
  for (int i = 0; i < G[x].size(); i++) {
    Edge e = edges[G[x][i]];
    if (e.to == pre) continue;
    if (deep[e.to]) {
      if (deep[e.to] < deep[x]) {
        rejs[lnk[e.to]].push_back(G[x][i] ^ 1);
      }
    } else {
      fae[e.to] = G[x][i];
      deep[e.to] = deep[x] + 1;
      lnk[x] = e.to;
      dfs(e.to, x);
    }
  }
}
int main() {
  T = read();
  while (T--) {
    n = read(), m = read(), s = read(), t = read();
    edges.clear();
    for (int i = 1; i <= n; i++) {
      G[i].clear();
      rejs[i].clear();
    }
    int a, b;
    for (int i = 1; i <= m; i++) {
      a = read(), b = read();
      edges.push_back(Edge(a, b));
      edges.push_back(Edge(b, a));
      G[a].push_back(edges.size() - 2);
      G[b].push_back(edges.size() - 1);
    }
    for (int i = 1; i <= n; i++) {
      deep[i] = fae[i] = lnk[i] = 0;
    }
    deep[s] = 1;
    dfs(s, s);
    bfs();
    bool flag = true;
    for (int i = 0; i < edges.size(); i += 2) {
      if (edges[i].dii == -1 && edges[i ^ 1].dii == -1) {
        flag = false;
        break;
      }
    }
    if (!flag)
      printf("No\n");
    else {
      printf("Yes\n");
      for (int i = 0; i < edges.size(); i += 2) {
        if (edges[i].dii == 1 || !edges[i ^ 1].dii)
          printf("%d %d\n", edges[i].from, edges[i].to);
        if (edges[i ^ 1].dii == 1 || !edges[i].dii)
          printf("%d %d\n", edges[i].to, edges[i].from);
      }
    }
  }
  return 0;
}