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;
int T;
int n, m, s, t;
vector<int> v[400086], w[400086];
int x, y;
int dep[400086], fa[400086][25], lg[400086];
bool vis[400086];
void dfs(int i) {
  for (int j = 1; j <= 20; j++) fa[i][j] = fa[fa[i][j - 1]][j - 1];
  for (int j = 0; j < v[i].size(); j++) {
    int to = v[i][j];
    if (dep[to]) {
      if (to ^ fa[i][0]) {
        int x = i;
        for (int k = 20; ~k; k--)
          if ((dep[i] - dep[to] - 1) & (1 << k)) x = fa[x][k];
        w[x].push_back(i);
      }
      continue;
    }
    fa[to][0] = i;
    dep[to] = dep[i] + 1;
    dfs(to);
  }
}
queue<pair<int, int> > q;
vector<pair<int, int> > ans;
int main() {
  scanf("%d", &T);
  for (int i = 2; i < 400086; i++) lg[i] = lg[i >> 1] + 1;
  while (T--) {
    scanf("%d%d%d%d", &n, &m, &s, &t);
    for (int i = 1; i <= n; i++) {
      v[i].clear(), w[i].clear(), dep[i] = 0, vis[i] = false;
      memset(fa[i], 0, sizeof(fa[i]));
    }
    for (int i = 1; i <= m; i++) {
      scanf("%d%d", &x, &y);
      v[x].push_back(y), v[y].push_back(x);
    }
    ans.clear();
    dep[s] = 1, dfs(s);
    q.push({t, 0});
    while (!q.empty()) {
      int x = q.front().first, y = q.front().second, f = fa[x][0];
      q.pop();
      if (vis[x] || !f) continue;
      vis[x] = true;
      if (y)
        ans.push_back({x, f});
      else
        ans.push_back({f, x});
      q.push({f, y});
      for (int i = 0; i < w[x].size(); i++) {
        int to = w[x][i];
        if (y)
          ans.push_back({to, f});
        else
          ans.push_back({f, to});
        q.push({to, y ^ 1});
      }
    }
    if (ans.size() < m) {
      puts("No");
    } else {
      puts("Yes");
      for (int i = 0; i < ans.size(); i++)
        printf("%d %d\n", ans[i].first, ans[i].second);
    }
  }
}