Problem: Nezzar designs a brand new game "Hidden Permutations" and shares it with his best friend, Nanako.

At the beginning of the game, Nanako and Nezzar both know integers n and m. The game goes in the following way:

  * Firstly, Nezzar hides two permutations p_1,p_2,…,p_n and q_1,q_2,…,q_n of integers from 1 to n, and Nanako secretly selects m unordered pairs (l_1,r_1),(l_2,r_2),…,(l_m,r_m); 
  * After that, Nanako sends his chosen pairs to Nezzar; 
  * On receiving those m unordered pairs, Nezzar checks if there exists 1 ≤ i ≤ m, such that (p_{l_i}-p_{r_i}) and (q_{l_i}-q_{r_i}) have different signs. If so, Nezzar instantly loses the game and gets a score of -1. Otherwise, the score Nezzar gets is equal to the number of indices 1 ≤ i ≤ n such that p_i ≠ q_i. 



However, Nezzar accidentally knows Nanako's unordered pairs and decides to take advantage of them. Please help Nezzar find out two permutations p and q such that the score is maximized.

Input

The first line contains a single integer t (1 ≤ t ≤ 5 ⋅ 10^5) — the number of test cases.

The first line of each test case contains two integers n,m (1 ≤ n ≤ 5 ⋅ 10^5, 0 ≤ m ≤ min((n(n-1))/(2),5 ⋅ 10^5)). 

Then m lines follow, i-th of them contains two integers l_i,r_i (1 ≤ l_i,r_i ≤ n, l_i ≠ r_i), describing the i-th unordered pair Nanako chooses. It is guaranteed that all m unordered pairs are distinct.

It is guaranteed that the sum of n for all test cases does not exceed 5 ⋅ 10^5, and the sum of m for all test cases does not exceed 5⋅ 10^5.

Output

For each test case, print two permutations p_1,p_2,…,p_n and q_1,q_2,…,q_n such that the score Nezzar gets is maximized.

Example

Input


3
4 2
1 2
3 4
6 4
1 2
1 3
3 5
3 6
2 1
1 2


Output


1 2 3 4
3 4 1 2
2 3 4 1 6 5
1 4 3 2 5 6
1 2
1 2

Note

For first test case, for each pair given by Nanako:

  * for the first pair (1,2): p_1 - p_2 = 1 - 2 = -1, q_1 - q_2 = 3 - 4 = -1, they have the same sign; 
  * for the second pair (3,4): p_3 - p_4 = 3 - 4 = -1, q_3 - q_4 = 1 - 2 = -1, they have the same sign. 



As Nezzar does not lose instantly, Nezzar gains the score of 4 as p_i ≠ q_i for all 1 ≤ i ≤ 4. Obviously, it is the maximum possible score Nezzar can get.

Solution (in CPP):

Solution:
#include<bits/stdc++.h>
#define fo(i,a,b) for(int i=a;i<=b;i++)
#define gc (p1==p2&&(p2=(p1=fr)+fread(fr,1,1<<20,stdin))==p1?EOF:*p1++)
#define fl fwrite(fw,1,p3-fw,stdout),p3=fw
char ch,fr[1<<21],*p1=fr,*p2=fr,fw[1<<21],*p3=fw;
void rd(int&x)
{
	while(!isdigit(ch=gc));x=ch-48;
	while( isdigit(ch=gc)) x=ch-48+x*10;
}
void pc(char c) {*p3++=c; if(p3-fw==1<<20)fl;}
void pt(int x) {if(x>9)pt(x/10); pc(x%10+48);}
using namespace std;
typedef pair<int,int>P;
const int N=5e5+9;
int T,n,m,X[N],Y[N],x,y,n1,c[N],sz[N],deg[N],t,d[N];
set<int>r,e[N],E[N];
struct Comp{bool operator()(const int&x,const int&y){return deg[x]>deg[y];}};
multiset<int,Comp>_;
multiset<int,Comp>::iterator it;
#define fi first
#define se second
P a[N],w[N];
void dg(int x)
{
	int y;
	for(set<int>::iterator it=r.begin();it!=r.end();)
		if(e[x].find(y=*it)==e[x].end())
		{
			E[x].insert(y);
			E[y].insert(x);
			r.erase(it); dg(y);
			it=r.lower_bound(y);
		}
		else it++;
}
int main()
{
	for(rd(T);T--;)
	{
		rd(n),rd(m); _.clear();
		fo(i,1,n) e[i].clear(), E[i].clear(), deg[i]=c[i]=sz[i]=0;
		fo(i,1,m)
		{
			rd(x),rd(y); deg[x]++,deg[y]++; X[i]=x,Y[i]=y;
			e[x].insert(y);
			e[y].insert(x);
		}
		fo(i,1,n) _.insert(i);
		n1=n;
//		n1=_.size();
		while(!_.empty())
		{
			if(deg[x=*_.begin()]<n1-1) break;
			_.erase(_.find(x)), n1--;
			for(int y:e[x])
			{
				_.erase(_.find(y));
				e[y].erase(x); deg[y]--; _.insert(y);
			}
		}
//		n1=_.size();
		if(!n1) goto DW;
		r.clear();
		r.insert(_.begin(),_.end());
		for(int x:_) if(r.find(x)!=r.end()) r.erase(x),dg(x);
		if(!r.empty())
		{
			puts("cyka blyat!");
			printf("%d %d\n",n,m);
			fo(i,1,m) printf("%d %d\n",X[i],Y[i]);
			return 0;
		}
		for(int x:_) 
		if(!c[x])
		{
			UP:for(int y:E[x]) if(!c[y]) d[++t]=y;
			if(t)
			{
				for(sz[c[x]=x]=t+1;t;t--) c[d[t]]=x;
				continue;
			}
			y=*E[x].begin();
			if(sz[c[y]]==2) {c[c[y]]=sz[c[y]]=0; x=y; goto UP;}
			else --sz[c[y]], sz[c[y]=c[x]=x]=2;
		}
		DW:int nw=0;
		for(int x:_) if(sz[x]) w[x]=a[x]=P(nw+sz[x],nw+1), nw+=sz[x];
		for(int x:_) if((y=c[x])^x) w[y]=a[x]=P(w[y].fi-1,w[y].se==a[y].se?a[y].fi:w[y].se-1);
//		n1=_.size();
		fo(i,1,n) if(_.find(i)==_.end()) ++nw,a[i]=P(nw,nw);
		fo(i,1,n) pt(a[i].fi),pc(' ');
		pc('\n');
		fo(i,1,n) pt(a[i].se),pc(' ');
		pc('\n');
	}
	fl;
}