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 namespace rel_ops;
using ll = int64_t;
using Pii = pair<int, int>;
using ull = uint64_t;
using Vi = vector<int>;
void run();
int main() {
  cin.sync_with_stdio(0);
  cin.tie(0);
  cout << fixed << setprecision(10);
  run();
  return 0;
}
int uplg(int n) { return 32 - __builtin_clz(n); }
int uplg(ll n) { return 64 - __builtin_clzll(n); }
struct Treap {
  struct Node {
    int E[2] = {-1, -1}, weight{rand()};
    int size{1}, par{-1};
  };
  vector<Node> G;
  Treap(int n = 0) { init(n); }
  void init(int n) {
    G.clear();
    G.resize(n);
  }
  int size(int first) { return (first >= 0 ? G[first].size : 0); }
  void push(int) {}
  void update(int first) {
    if (first >= 0) {
      G[first].par = -1;
      int& s = G[first].size = 1;
      for (auto& e : (G[first].E))
        if (e >= 0) {
          s += size(e);
          G[e].par = first;
        }
    }
  }
  void split(int first, int& l, int& r, int i) {
    push(first);
    l = r = -1;
    if (first < 0) return;
    int key = size(G[first].E[0]);
    if (i <= key) {
      split(G[first].E[0], l, G[first].E[0], i);
      r = first;
    } else {
      split(G[first].E[1], G[first].E[1], r, i - key - 1);
      l = first;
    }
    update(first);
  }
  int join(int l, int r) {
    push(l);
    push(r);
    if (l < 0 || r < 0) return max(l, r);
    if (G[l].weight < G[r].weight) {
      G[l].E[1] = join(G[l].E[1], r);
      update(l);
      return l;
    }
    G[r].E[0] = join(l, G[r].E[0]);
    update(r);
    return r;
  }
  int find(int first, int i) {
    while (first >= 0) {
      push(first);
      int key = size(G[first].E[0]);
      if (key == i) return first;
      first = G[first].E[key < i];
      if (key < i) i -= key + 1;
    }
    return first;
  }
  int index(int first) {
    int prev = -2, i = 0;
    while (first != -1) {
      if (G[first].E[0] != prev) i += size(G[first].E[0]) + 1;
      prev = first;
      first = G[first].par;
    }
    return i - 1;
  }
};
struct Vert {
  Vi E, forward, back;
  bool visited{0}, merged{0}, onPath{0}, processed{0};
  int par{-1}, in{0}, out{0};
};
int n, m, s, t;
vector<Vert> G;
vector<Pii> ans;
Treap topo;
int topoRoot;
void dfs(int i) {
  G[i].visited = G[i].onPath = 1;
  for (auto& e : (G[i].E))
    if (e != G[i].par) {
      if (G[e].visited) {
        if (G[e].onPath) G[e].back.push_back(i);
      } else {
        G[i].forward.push_back(e);
        G[e].par = i;
        dfs(e);
      }
    }
  G[i].onPath = 0;
}
void direct(int i, int src) {
  int finish = G[i].par;
  while (finish != -1 && !G[finish].merged) {
    finish = G[finish].par;
  }
  bool rev = (topo.index(finish) < topo.index(src));
  int tree = -1;
  while (i != finish) {
    G[i].merged = 1;
    if (rev)
      tree = topo.join(i, tree);
    else
      tree = topo.join(tree, i);
    i = G[i].par;
  }
  int L, R, index = topo.index(finish);
  topo.split(topoRoot, L, R, index + rev);
  L = topo.join(L, tree);
  topoRoot = topo.join(L, R);
}
bool solve() {
  cin >> n >> m >> s >> t;
  s--;
  t--;
  G.assign(n, {});
  ans.clear();
  topo.init(n);
  topoRoot = -1;
  for (int i = (0); i < (m); i++) {
    int a, b;
    cin >> a >> b;
    a--;
    b--;
    G[a].E.push_back(b);
    G[b].E.push_back(a);
  }
  dfs(s);
  if (!G[t].visited) return false;
  direct(t, t);
  queue<int> que;
  que.push(s);
  while (!que.empty()) {
    int i = que.front();
    que.pop();
    if (G[i].processed) continue;
    G[i].processed = 1;
    for (auto& e : (G[i].back)) {
      if (!G[e].merged) direct(e, i);
    }
    for (auto& e : (G[i].forward)) que.push(e);
  }
  for (int i = (0); i < (n); i++) {
    for (auto& e : (G[i].E)) {
      if (topo.index(i) < topo.index(e)) {
        ans.push_back({i, e});
        G[i].out++;
        G[e].in++;
      }
    }
  }
  if (G[s].in != 0 || G[t].out != 0) return false;
  for (int i = (0); i < (n); i++)
    if (i != s && i != t) {
      if (G[i].in == 0 || G[i].out == 0) return false;
    }
  return true;
}
void run() {
  int k;
  cin >> k;
  while (k--) {
    if (solve()) {
      cout << "Yes\n";
      for (auto& p : (ans)) cout << p.first + 1 << ' ' << p.second + 1 << '\n';
    } else {
      cout << "No\n";
    }
  }
}