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 <typename T>
inline void upmax(T& first, T second) {
  first < second ? first = second : 0;
}
template <typename T>
inline void upmin(T& first, T second) {
  first > second ? first = second : 0;
}
template <typename T>
inline void read(T& first) {
  char c;
  while ((c = getchar()) < '0' || c > '9')
    ;
  for (first = c - '0'; (c = getchar()) >= '0' && c <= '9';
       first = first * 10 + c - '0')
    ;
}
const int inf = 0x3f3f3f3f;
const int N = 4e5 + 10, M = 1e6 + 10;
pair<int, int> edges[M];
vector<pair<int, int> > adj[N], aux[N];
int dir[M];
int fa[N], fae[N], dep[N], nxt[N];
bool vis[N];
int n, m, s, t;
stack<pair<int, int> > sta;
queue<pair<int, int> > que;
void work() {
  read(n), read(m);
  read(s), read(t);
  for (int i = (1), _ = (n); i <= _; ++i) {
    adj[i].clear();
    aux[i].clear();
    vis[i] = 0;
  }
  int first, second;
  for (int i = (1), _ = (m); i <= _; ++i) {
    read(edges[i].first), read(edges[i].second);
    adj[edges[i].first].push_back(make_pair(edges[i].second, i));
    adj[edges[i].second].push_back(make_pair(edges[i].first, i));
    dir[i] = -1;
  }
  dep[s] = 0;
  fa[s] = 0;
  vis[s] = 1;
  sta.push(make_pair(s, 0));
  while (!sta.empty()) {
    pair<int, int> u = make_pair(sta.top().first, sta.top().second++);
    if (u.second == (int((adj[u.first]).size()))) {
      sta.pop();
      continue;
    }
    int to = adj[u.first][u.second].first;
    if (to == fa[u.first]) continue;
    if (!vis[to]) {
      vis[to] = 1;
      nxt[u.first] = to;
      dep[to] = dep[u.first] + 1;
      fa[to] = u.first;
      fae[to] = adj[u.first][u.second].second;
      sta.push(make_pair(to, 0));
    } else if (dep[to] < dep[u.first]) {
      aux[nxt[to]].push_back(make_pair(u.first, adj[u.first][u.second].second));
    }
  }
  if (!vis[t]) {
    puts("No");
    return;
  }
  que.push(make_pair(t, 1));
  while (!que.empty()) {
    pair<int, int> u = que.front();
    que.pop();
    while (fa[u.first] and dir[fae[u.first]] == -1) {
      dir[fae[u.first]] = u.second;
      for (auto p : aux[u.first]) {
        dir[p.second] = u.second;
        que.push(make_pair(p.first, u.second ^ 1));
      }
      u.first = fa[u.first];
    }
  }
  for (int i = (1), _ = (m); i <= _; ++i) {
    if (dir[i] == -1) {
      puts("No");
      return;
    }
  }
  puts("Yes");
  for (int i = (1), _ = (m); i <= _; ++i) {
    if ((dep[edges[i].first] < dep[edges[i].second]) != dir[i])
      swap(edges[i].first, edges[i].second);
    printf("%d %d\n", edges[i].first, edges[i].second);
  }
}
int main() {
  int kase;
  read(kase);
  while (kase--) work();
  return 0;
}