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>
#pragma GCC target("avx2")
#pragma GCC optimize("O3")
#pragma GCC optimize("unroll-loops")
using namespace std;
template <class T, class S>
ostream &operator<<(ostream &o, const pair<T, S> &p) {
  return o << '(' << p.first << ", " << p.second << ')';
}
template <template <class, class...> class T, class... A>
typename enable_if<!is_same<T<A...>, string>(), ostream &>::type operator<<(
    ostream &o, T<A...> V) {
  o << '[';
  for (auto a : V) o << a << ", ";
  return o << ']';
}
vector<long long int> graph[400010], back[400010], tree[400010];
long long int dep[400010], par[400010];
void dfs(long long int i, long long int p) {
  par[i] = p;
  dep[i] = dep[p] + 1;
  for (long long int j : graph[i])
    if (j - p) {
      if (!dep[j]) {
        tree[i].push_back(j);
        dfs(j, i);
      } else if (dep[j] < dep[i])
        back[i].push_back(j);
    }
}
bool up[400010], secup[400010];
long long int mindep[400010];
string ok;
long long int sortedges(long long int i) {
  mindep[i] = 400010;
  for (long long int j : back[i]) mindep[i] = min(mindep[i], dep[j]);
  for (long long int j : tree[i]) mindep[i] = min(mindep[i], sortedges(j));
  sort((tree[i]).begin(), (tree[i]).end(),
       [](long long int j, long long int k) { return mindep[j] < mindep[k]; });
  return mindep[i];
}
void chain(long long int i, long long int c);
void makechain(long long int i, long long int j, long long int c) {
  if (ok[0] == 'N') return;
  for (long long int c2 = i; c2 - c; c2 = par[c2])
    up[c2] = secup[c2] = !secup[j];
  secup[c] = !secup[j];
  for (long long int lst = -1, c2 = i; c2 - c; lst = c2, c2 = par[c2])
    for (long long int x : tree[c2])
      if (x - lst) chain(x, c2);
}
void chain(long long int i, long long int c) {
  if (ok[0] == 'N') return;
  for (long long int j : back[i])
    if (dep[j] < dep[c]) {
      makechain(i, j, c);
      return;
    }
  if (tree[i].empty())
    ok = "No\n";
  else
    chain(tree[i][0], c);
}
void printback(long long int i) {
  secup[par[i]] = up[i];
  for (long long int j : back[i]) {
    if (secup[j])
      cout << i << ' ' << j << '\n';
    else
      cout << j << ' ' << i << '\n';
  }
  for (long long int j : tree[i]) printback(j);
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  secup[400010 - 1] = true;
  long long int tc;
  cin >> tc;
  while (tc--) {
    long long int n;
    cin >> n;
    long long int m;
    cin >> m;
    long long int s;
    cin >> s;
    long long int t;
    cin >> t;
    ok = "Yes\n";
    while (m--) {
      long long int u;
      cin >> u;
      long long int v;
      cin >> v;
      graph[u].push_back(v);
      graph[v].push_back(u);
    }
    dfs(s, s);
    sortedges(s);
    if (tree[s].size() - 1) ok = "No\n";
    makechain(t, 400010 - 1, s);
    cout << ok;
    if (ok[0] == 'Y') {
      for (long long int i = 1; i < (n + 1); ++i)
        if (i - s) {
          if (up[i])
            cout << i << ' ' << par[i] << '\n';
          else
            cout << par[i] << ' ' << i << '\n';
        }
      printback(s);
    }
    for (long long int i = 1; i < (n + 1); ++i)
      graph[i].clear(), back[i].clear(), tree[i].clear();
    fill_n(dep, n + 1, 0);
  }
}