#include <bits/stdc++.h>
using namespace std;

using lint = long long int;
using pint = pair<int, int>;
using plint = pair<lint, lint>;
#define ALL(x) (x).begin(), (x).end()
#define SZ(x) ((lint)(x).size())
#define POW2(n) (1LL << (n))
#define FOR(i, begin, end) for (int i = (begin), i##_end_ = (end); i < i##_end_; i++)
#define IFOR(i, begin, end) for (int i = (end)-1, i##_begin_ = (begin); i >= i##_begin_; i--)
#define REP(i, n) FOR(i, 0, n)
#define IREP(i, n) IFOR(i, 0, n)
#ifdef LOCAL
#define eprintf(...) fprintf(stderr, __VA_ARGS__)
#else
#define eprintf(...) 42
#endif

int main()
{
    int n, m;
    cin >> n >> m;

    vector<vector<int>> x(n+1, vector<int>(n+1, 0));

    int ans=0,tmp;


    int a, b;
    REP(i, m) { 
        cin >> a>>b;
        x[a][b] = 1;
    }
    REP(_,max(10,n/6))
    REP(i,n+1)REP(j,n+1){
        if(x[i][j] == 1){
            REP(k, n+1)
            x[i][k] = max(x[i][k],x[j][k]);
        }
    }

    
    FOR(i, 1, n + 1)
    {
        string s = "";
        FOR(j, 1, n + 1)
        {
            if(i==j){
                //cout << i << " ";
                s += to_string(i) + " ";
            }else if(x[i][j]+x[j][i]==2){
                //cout << j <<" ";
                s += to_string(j) + " ";
            }
        }
        //cout << "\n";
        s.erase(--s.end());
        cout << s << "\n";
    }
    //cout << s << "/n";

    return 0;
}

### Prompt

Please provide a Cpp coded solution to the problem described below:

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;

using lint = long long int;
using pint = pair<int, int>;
using plint = pair<lint, lint>;
#define ALL(x) (x).begin(), (x).end()
#define SZ(x) ((lint)(x).size())
#define POW2(n) (1LL << (n))
#define FOR(i, begin, end) for (int i = (begin), i##_end_ = (end); i < i##_end_; i++)
#define IFOR(i, begin, end) for (int i = (end)-1, i##_begin_ = (begin); i >= i##_begin_; i--)
#define REP(i, n) FOR(i, 0, n)
#define IREP(i, n) IFOR(i, 0, n)
#ifdef LOCAL
#define eprintf(...) fprintf(stderr, __VA_ARGS__)
#else
#define eprintf(...) 42
#endif

int main()
{
    int n, m;
    cin >> n >> m;

    vector<vector<int>> x(n+1, vector<int>(n+1, 0));

    int ans=0,tmp;


    int a, b;
    REP(i, m) { 
        cin >> a>>b;
        x[a][b] = 1;
    }
    REP(_,max(10,n/6))
    REP(i,n+1)REP(j,n+1){
        if(x[i][j] == 1){
            REP(k, n+1)
            x[i][k] = max(x[i][k],x[j][k]);
        }
    }

    
    FOR(i, 1, n + 1)
    {
        string s = "";
        FOR(j, 1, n + 1)
        {
            if(i==j){
                //cout << i << " ";
                s += to_string(i) + " ";
            }else if(x[i][j]+x[j][i]==2){
                //cout << j <<" ";
                s += to_string(j) + " ";
            }
        }
        //cout << "\n";
        s.erase(--s.end());
        cout << s << "\n";
    }
    //cout << s << "/n";

    return 0;
}

```