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 MOD = (int)1e9 + 7;
const int INF = (int)1e9;
const long long LINF = (long long)1e18;
const long double PI = acos((long double)-1);
const long double EPS = 1e-9;
inline long long gcd(long long a, long long b) {
  long long r;
  while (b) {
    r = a % b;
    a = b;
    b = r;
  }
  return a;
}
inline long long lcm(long long a, long long b) { return a / gcd(a, b) * b; }
inline long long fpow(long long n, long long k, int p = MOD) {
  long long r = 1;
  for (; k; k >>= 1) {
    if (k & 1) r = r * n % p;
    n = n * n % p;
  }
  return r;
}
template <class T>
inline int chkmin(T& a, const T& val) {
  return val < a ? a = val, 1 : 0;
}
template <class T>
inline int chkmax(T& a, const T& val) {
  return a < val ? a = val, 1 : 0;
}
template <class T>
inline T isqrt(T k) {
  T r = sqrt(k) + 1;
  while (r * r > k) r--;
  return r;
}
template <class T>
inline T icbrt(T k) {
  T r = cbrt(k) + 1;
  while (r * r * r > k) r--;
  return r;
}
inline void addmod(int& a, int val, int p = MOD) {
  if ((a = (a + val)) >= p) a -= p;
}
inline void submod(int& a, int val, int p = MOD) {
  if ((a = (a - val)) < 0) a += p;
}
inline int mult(int a, int b, int p = MOD) { return (long long)a * b % p; }
inline int inv(int a, int p = MOD) { return fpow(a, p - 2, p); }
const int maxn = 400000 + 10;
const int maxm = 1000000 + 10;
int n, m, s, t;
pair<int, int> edge[maxm];
vector<pair<int, int> > adj[maxn];
vector<pair<int, int> > g[maxn];
int dir[maxm];
int vis[maxn];
int lev[maxn];
pair<int, int> p[maxn];
int nxt[maxn];
void dfs(int u) {
  vis[u] = 1;
  for (int i = (0); i < (int((adj[u]).size())); i++) {
    int v = adj[u][i].first;
    int ix = adj[u][i].second;
    if (!vis[v]) {
      lev[v] = lev[u] + 1;
      p[v] = make_pair(u, ix);
      nxt[u] = v;
      dfs(v);
    } else if (lev[v] < lev[u]) {
      g[nxt[v]].push_back(make_pair(u, ix));
    }
  }
}
void setedge(int from, int ix) {
  if (edge[ix].first != from) swap(edge[ix].first, edge[ix].second);
}
void work() {
  cin >> n >> m >> s >> t;
  s--, t--;
  for (int i = (0); i < (n); i++) adj[i].clear(), g[i].clear();
  fill_n(vis, n, 0);
  fill_n(dir, m, -1);
  fill_n(p, n, make_pair(-1, -1));
  for (int i = (0); i < (m); i++) {
    int u, v;
    cin >> u >> v;
    u--, v--;
    adj[u].push_back(make_pair(v, i));
    adj[v].push_back(make_pair(u, i));
    edge[i] = make_pair(u, v);
  }
  lev[s] = 0;
  dfs(s);
  if (!vis[t]) {
    cout << "No\n";
    return;
  }
  queue<pair<int, int> > que;
  que.push(make_pair(t, 1));
  while (int((que).size())) {
    int u = que.front().first;
    int w = que.front().second;
    que.pop();
    while (p[u] != make_pair(-1, -1) && dir[p[u].second] == -1) {
      dir[p[u].second] = w;
      if (w)
        setedge(p[u].first, p[u].second);
      else
        setedge(u, p[u].second);
      for (int i = (0); i < (int((g[u]).size())); i++) {
        int v = g[u][i].first;
        int ix = g[u][i].second;
        dir[ix] = w;
        if (w)
          setedge(p[u].first, ix);
        else
          setedge(v, ix);
        que.push(make_pair(v, w ^ 1));
      }
      u = p[u].first;
    }
  }
  for (int i = (0); i < (m); i++) {
    if (dir[i] == -1) {
      cout << "No\n";
      return;
    }
  }
  cout << "Yes\n";
  for (int i = (0); i < (m); i++) {
    cout << edge[i].first + 1 << " " << edge[i].second + 1 << "\n";
  }
}
void solve() {
  int test;
  cin >> test;
  while (test--) {
    work();
  }
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  solve();
  return 0;
}