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 N = 4.1e5;
vector<int> adj[N];
vector<int> path;
bool act[N];
int seen[N];
int typ = 17;
int dfs(int u, int bad) {
  if (seen[u] == typ) return 0;
  seen[u] = typ;
  if (u == bad) return 0;
  if (act[u]) return u;
  path.push_back(u);
  for (int v : adj[u]) {
    int rec = dfs(v, bad);
    if (rec) return rec;
  }
  path.pop_back();
  return 0;
}
int main() {
  int T;
  scanf("%d", &T);
  for (; T--;) {
    int n, m, s, t;
    scanf("%d%d%d%d", &n, &m, &s, &t);
    vector<pair<int, int> > edges;
    for (int i = 1; i <= n; i++) adj[i].clear();
    for (int i = 0; i < m; i++) {
      int x, y;
      scanf("%d%d", &x, &y);
      adj[x].push_back(y);
      adj[y].push_back(x);
      edges.push_back({x, y});
    }
    static int nx[N], pr[N];
    for (int i = 1; i <= n; i++) nx[i] = pr[i] = -1;
    for (int i = 1; i <= n; i++) act[i] = 0;
    nx[s] = t;
    pr[t] = s;
    pr[s] = -1;
    nx[t] = -1;
    vector<pair<int, int> > act_edges;
    for (int u : adj[s]) act_edges.push_back({s, u});
    for (int u : adj[t]) act_edges.push_back({t, u});
    act[s] = act[t] = 1;
    int u = s;
    for (; u != t; u = nx[u]) {
      for (int w : adj[u]) {
        assert(act[u]);
        if (act[w]) continue;
        path.clear();
        ++typ;
        int v = dfs(w, u);
        if (!v) goto die;
        assert(u != t);
        assert(nx[u] != -1);
        assert(v != u);
        for (; !path.empty();) {
          int x = path.back();
          path.pop_back();
          act[x] = 1;
          for (int y : adj[x]) act_edges.push_back({x, y});
          pr[nx[u]] = x;
          nx[x] = nx[u];
          pr[x] = u;
          nx[u] = x;
        }
      }
    }
    for (int i = 1; i <= n; i++)
      if (nx[i] == -1 && pr[i] == -1) goto die;
    {
      vector<int> ans;
      for (int x = s; x != -1; x = nx[x]) {
        ans.push_back(x);
      }
      vector<int> rans(n + 3);
      for (int i = 0; i < n; i++) rans[ans[i]] = i;
      printf("Yes\n");
      for (auto &e : edges) {
        int u = e.first, v = e.second;
        if (rans[u] > rans[v]) swap(u, v);
        assert(rans[u] < rans[v]);
        printf("%d %d\n", u, v);
      }
    }
    continue;
  die:
    printf("No\n");
  }
}