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;
using ll = long long;
using pii = pair<ll, ll>;
using vi = vector<ll>;
using ld = long double;
template <class T, class U>
ostream& operator<<(ostream& os, const pair<T, U>& p) {
  os << "(" << p.first << "," << p.second << ")";
  return os;
}
template <class T>
ostream& operator<<(ostream& os, const vector<T>& v) {
  os << "[";
  for (ll i = ll(0); i < ll((ll)v.size()); i++) {
    if (i) os << ",";
    os << v[i];
  }
  os << "]";
  return os;
}
ll read() {
  ll i;
  scanf("%lld", &i);
  return i;
}
void printSpace() { printf(" "); }
void printEoln() { printf("\n"); }
void print(ll x, ll suc = 1) {
  printf("%lld", x);
  if (suc == 1) printEoln();
  if (suc == 2) printSpace();
}
string readString() {
  static char buf[3341919];
  scanf("%s", buf);
  return string(buf);
}
char* readCharArray() {
  static char buf[3341919];
  static ll bufUsed = 0;
  char* ret = buf + bufUsed;
  scanf("%s", ret);
  bufUsed += strlen(ret) + 1;
  return ret;
}
template <class T, class U>
void chmax(T& a, U b) {
  if (a < b) a = b;
}
template <class T, class U>
void chmin(T& a, U b) {
  if (a > b) a = b;
}
template <class T>
T Sq(const T& t) {
  return t * t;
}
struct Wafrelka {
  struct Edge {
    ll to, idx;
  };
  vector<vector<Edge>> g;
  vector<pii> ans;
  vi ord, low;
  vi z;
  void dfs1(ll v, ll d, ll t) {
    ord[v] = low[v] = d;
    z[v] = (v == t);
    for (auto e : g[v]) {
      if (ord[e.to] == -1) {
        dfs1(e.to, d + 1, t);
        chmin(low[v], low[e.to]);
        z[v] |= z[e.to];
      } else if (ord[e.to] < ord[v] - 1)
        chmin(low[v], ord[e.to]);
    }
  }
  void dfs2(ll v, ll w, bool u) {
    if (low[v] >= w) {
      w = ord[v] - 1;
      u ^= true;
    }
    for (auto e : g[v])
      if (ord[e.to] < ord[v]) {
        bool q = ord[e.to] < w;
        if (u ^ q)
          ans[e.idx] = make_pair(v, e.to);
        else
          ans[e.idx] = make_pair(e.to, v);
      } else if (ord[v] + 1 == ord[e.to])
        dfs2(e.to, w, u);
  }
  void Tokeru() {
    ll n = read(), m = read(), s = read() - 1, t = read() - 1;
    g.resize(n);
    ans.resize(m, pii(-1, -1));
    for (ll i = ll(0); i < ll(m); i++) {
      ll x = read() - 1, y = read() - 1;
      g[x].push_back(Edge{y, i});
      g[y].push_back(Edge{x, i});
    }
    ord.resize(n, -1);
    low.resize(n, -1);
    z.resize(n, false);
    dfs1(s, 0, t);
    for (ll i = ll(0); i < ll(n); i++)
      if (z[i]) {
        for (auto e : g[i])
          if (ord[i] + 1 == ord[e.to] && !z[e.to])
            if (low[e.to] >= ord[i]) {
              printf("No\n");
              return;
            }
      } else if (low[i] == ord[i]) {
        printf("No\n");
        return;
      }
    for (ll i = ll(0); i < ll(n); i++)
      if (z[i])
        for (auto e : g[i]) {
          if (ord[i] - 1 > ord[e.to])
            ans[e.idx] = make_pair(e.to, i);
          else if (ord[i] + 1 == ord[e.to]) {
            if (z[e.to])
              ans[e.idx] = make_pair(i, e.to);
            else
              dfs2(e.to, ord[i], true);
          }
        }
    vi in(n, 0), out(n, 0);
    for (ll i = ll(0); i < ll(m); i++) out[ans[i].first]++, in[ans[i].second]++;
    if (in[s] != 0) {
      printf("No\n");
      return;
    }
    if (out[t] != 0) {
      printf("No\n");
      return;
    }
    for (ll i = ll(0); i < ll(n); i++)
      if (i != s && i != t) {
        if (in[i] == 0 || out[i] == 0) {
          printf("No\n");
          return;
        }
      }
    printf("Yes\n");
    for (ll i = ll(0); i < ll(m); i++)
      print(ans[i].first + 1, 2), print(ans[i].second + 1);
  }
};
signed main() {
  ll t = read();
  while (t--) {
    Wafrelka w;
    w.Tokeru();
  }
}