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;
template <class C>
void mini(C &a4, C b4) {
  a4 = min(a4, b4);
}
template <class C>
void maxi(C &a4, C b4) {
  a4 = max(a4, b4);
}
template <class TH>
void _dbg(const char *sdbg, TH h) {
  cerr << sdbg << "=" << h << "\n";
}
template <class TH, class... TA>
void _dbg(const char *sdbg, TH h, TA... a) {
  while (*sdbg != ',') cerr << *sdbg++;
  cerr << "=" << h << ",";
  _dbg(sdbg + 1, a...);
}
template <class T>
ostream &operator<<(ostream &os, vector<T> V) {
  os << "[";
  for (auto v : V) os << v << ",";
  os << ']';
  return os;
}
template <class L, class R>
ostream &operator<<(ostream &os, pair<L, R> P) {
  return os << "(" << P.first << ", " << P.second << ")";
}
struct Rozw {
  long long n, m, s, t;
  vector<vector<long long>> d;
  vector<pair<long long, long long>> res;
  vector<long long> low, po, typ, par;
  long long io = 0;
  bool xx = 0;
  void dfs_low(long long nr, long long oj) {
    if (po[nr] != -1) return;
    par[nr] = oj;
    po[nr] = low[nr] = io;
    io++;
    for (long long ak : d[nr]) {
      if (ak != oj) {
        dfs_low(ak, nr);
      }
    }
    for (long long ak : d[nr]) {
      if (ak != oj) {
        mini(low[nr], low[ak]);
      }
    }
    if (oj != -1 && low[nr] >= po[oj] && nr != s) xx = 1;
  }
  void licz(long long nr) {
    typ[po[par[nr]]] = !typ[low[nr]];
    for (long long ak : d[nr]) {
      if (po[ak] < po[nr]) {
        if (typ[po[ak]]) {
          res.push_back({nr, ak});
        } else {
          res.push_back({ak, nr});
        }
      } else if (par[ak] == nr) {
        licz(ak);
      }
    }
  }
  void go() {
    cin >> n >> m >> s >> t;
    s--;
    t--;
    d.resize(n);
    low.resize(n);
    po.resize(n, -1);
    par.resize(n);
    typ.resize(n);
    d[t].push_back(s);
    for (long long i = (0); i <= ((long long)(m)-1); i++) {
      long long a, b;
      cin >> a >> b;
      a--;
      b--;
      if ((a == s && b == t) || (a == t && b == s)) {
        res.push_back({s, t});
      } else {
        d[a].push_back(b);
        d[b].push_back(a);
      }
    }
    dfs_low(t, -1);
    if (xx) {
      cout << "No\n";
    } else {
      cout << "Yes\n";
      licz(s);
      for (pair<long long, long long> el : res) {
        cout << el.first + 1 << " " << el.second + 1 << "\n";
      }
    }
  }
};
int32_t main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout << fixed << setprecision(11);
  if (0) cout << fixed << setprecision(6);
  long long t;
  cin >> t;
  while (t--) {
    Rozw rozw;
    rozw.go();
  }
}