#include <bits/stdc++.h>

using namespace std;

#define REP(i,n) for(ll (i) = (0);(i) < (n);++i)
#define REV(i,n) for(ll (i) = (n) - 1;(i) >= 0;--i)
#define PB push_back
#define EB emplace_back
#define MP make_pair
#define FI first
#define SE second
#define SHOW1d(v,n) {REP(WW,n)cerr << v[WW] << ' ';cerr << endl << endl;}
#define SHOW2d(v,WW,HH) {REP(W_,WW){REP(H_,HH)cerr << v[W_][H_] << ' ';cerr << endl;}cerr << endl;}
#define ALL(v) v.begin(),v.end()
#define Decimal fixed<<setprecision(20)
#define INF 1000000000
#define LLINF 1000000000000000000LL
#define MOD 998244353

typedef long long ll;
typedef pair<ll,ll> P;

ll mp[333][333];

int main(){
	cin.tie(0);cout.tie(0);ios::sync_with_stdio(false);

    REP(i, 333)REP(j, 333)if(i != j)mp[i][j] = INF;

    ll n, m;cin >> n >> m;
    REP(i, m){
        ll a, b;cin >> a >> b;a--;b--;
        mp[a][b] = 0;
    }

    REP(k, 333)REP(i, 333)REP(j, 333)mp[i][j] = min(mp[i][j], mp[i][k] + mp[k][j]);

    REP(i, n){
        bool flag = false;
        REP(j, n){
            if(mp[i][j] == 0 && mp[j][i] == 0){
                if(flag)cout << " ";
                cout << (j + 1);
                flag = true;
            }
        }
        cout << endl;
    }

	return 0;
}


### 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 REP(i,n) for(ll (i) = (0);(i) < (n);++i)
#define REV(i,n) for(ll (i) = (n) - 1;(i) >= 0;--i)
#define PB push_back
#define EB emplace_back
#define MP make_pair
#define FI first
#define SE second
#define SHOW1d(v,n) {REP(WW,n)cerr << v[WW] << ' ';cerr << endl << endl;}
#define SHOW2d(v,WW,HH) {REP(W_,WW){REP(H_,HH)cerr << v[W_][H_] << ' ';cerr << endl;}cerr << endl;}
#define ALL(v) v.begin(),v.end()
#define Decimal fixed<<setprecision(20)
#define INF 1000000000
#define LLINF 1000000000000000000LL
#define MOD 998244353

typedef long long ll;
typedef pair<ll,ll> P;

ll mp[333][333];

int main(){
	cin.tie(0);cout.tie(0);ios::sync_with_stdio(false);

    REP(i, 333)REP(j, 333)if(i != j)mp[i][j] = INF;

    ll n, m;cin >> n >> m;
    REP(i, m){
        ll a, b;cin >> a >> b;a--;b--;
        mp[a][b] = 0;
    }

    REP(k, 333)REP(i, 333)REP(j, 333)mp[i][j] = min(mp[i][j], mp[i][k] + mp[k][j]);

    REP(i, n){
        bool flag = false;
        REP(j, n){
            if(mp[i][j] == 0 && mp[j][i] == 0){
                if(flag)cout << " ";
                cout << (j + 1);
                flag = true;
            }
        }
        cout << endl;
    }

	return 0;
}


```