#include <bits/stdc++.h>
using namespace std;
#define int long long
#define FOR(i, s, n) for (int i = (s); i < (int)(n); i++)
#define RFOR(i, s, n) for (int i = (n) - 1; i >= (int)(s); i--)
#define REP(i, n) FOR(i, 0, n)
#define RREP(i, n) RFOR(i, 0, n)
#define ALL(a) a.begin(), a.end()
constexpr long long INF = 1e18;
template<class T>inline bool CHMAX(T&a,T b){if(a<b){a=b;return true;}return false;}
template<class T>inline bool CHMIN(T&a,T b){if(a>b){a=b;return true;}return false;}

int d[303][303];
void warshall_floyd(int n) { // nは頂点数
  for (int i = 0; i < n; i++)      // 経由する頂点
    for (int j = 0; j < n; j++)    // 開始頂点
      for (int k = 0; k < n; k++)  // 終端
        d[j][k] = min(d[j][k], d[j][i] + d[i][k]);
}

signed main(){
	int N,M;
	cin >> N >> M;
	REP(i,303)REP(j,303)d[i][j] = INF;
	REP(i,303)d[i][i] = 0;
	REP(i,M){
		int a,b;
		cin >> a >> b;
		a--;b--;
		d[a][b] = 1;
	}
	warshall_floyd(N);
	vector<int>ans[N];
	
	REP(i,N){
		REP(j,N){
			if(d[i][j]!=INF&&d[j][i]!=INF)ans[i].push_back(j+1);
		}
		REP(j,ans[i].size())cout << ans[i][j] << " \n"[j+1 == ans[i].size()];
	}
}


### Prompt

Create a solution in Cpp for the following problem:

problem

There are $ N $ propositions, named $ 1, 2, \ cdots, N $, respectively. Also, $ M $ information about the propositions is given. The $ i $ th information is "$ a_i $$". Given in the form "b_i $", which means that $ a_i $ is $ b_i $. ("If" is a logical conditional and the transition law holds.) $ For each proposition $ i $ Output all propositions that have the same value as i $ in ascending order. However, proposition $ i $ and proposition $ i $ are always the same value. Proposition $ X $ and proposition $ Y $ have the same value as "$ if $ X $". It means "Y $" and "$ X $ if $ Y $".



output

On the $ i $ line, output all propositions that have the same value as the proposition $ i $, separated by blanks in ascending order. Also, output a line break at the end of each line.

Example

Input

5 2
1 2
2 1


Output

1 2
1 2
3
4
5

### Response

```cpp
#include <bits/stdc++.h>
using namespace std;
#define int long long
#define FOR(i, s, n) for (int i = (s); i < (int)(n); i++)
#define RFOR(i, s, n) for (int i = (n) - 1; i >= (int)(s); i--)
#define REP(i, n) FOR(i, 0, n)
#define RREP(i, n) RFOR(i, 0, n)
#define ALL(a) a.begin(), a.end()
constexpr long long INF = 1e18;
template<class T>inline bool CHMAX(T&a,T b){if(a<b){a=b;return true;}return false;}
template<class T>inline bool CHMIN(T&a,T b){if(a>b){a=b;return true;}return false;}

int d[303][303];
void warshall_floyd(int n) { // nは頂点数
  for (int i = 0; i < n; i++)      // 経由する頂点
    for (int j = 0; j < n; j++)    // 開始頂点
      for (int k = 0; k < n; k++)  // 終端
        d[j][k] = min(d[j][k], d[j][i] + d[i][k]);
}

signed main(){
	int N,M;
	cin >> N >> M;
	REP(i,303)REP(j,303)d[i][j] = INF;
	REP(i,303)d[i][i] = 0;
	REP(i,M){
		int a,b;
		cin >> a >> b;
		a--;b--;
		d[a][b] = 1;
	}
	warshall_floyd(N);
	vector<int>ans[N];
	
	REP(i,N){
		REP(j,N){
			if(d[i][j]!=INF&&d[j][i]!=INF)ans[i].push_back(j+1);
		}
		REP(j,ans[i].size())cout << ans[i][j] << " \n"[j+1 == ans[i].size()];
	}
}


```