#include<stdio.h>
int main() {
	int n, m, i, j, k, data[301][301] = {}, a, b,flag;
	scanf("%d%d", &n, &m);
	for (i = 1; i <= m; ++i) {
		scanf("%d%d", &a, &b);
		data[a][b] = 1;
	}
	for (i = 1; i <= n; ++i) {
		for (j = 1; j <= n; ++j) {
			for (k = 1; k <= n; ++k) {
				if (data[j][i] && data[i][k]) data[j][k] = 1;
			}
		}
	}
	for (i = 1; i <= n; ++i) {
		flag = 0;
		for (j = 1; j <= n; ++j) {
			if (i == j) {
				if (flag) printf(" ");
				printf("%d",i); flag = 1;
			}
			if (i != j && data[i][j] && data[j][i]) {
				if (flag) printf(" ");
				printf("%d", j); flag = 1;
			}
		}
		printf("\n");
	}
	return 0;
}

### Prompt

In cpp, your task is to solve 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<stdio.h>
int main() {
	int n, m, i, j, k, data[301][301] = {}, a, b,flag;
	scanf("%d%d", &n, &m);
	for (i = 1; i <= m; ++i) {
		scanf("%d%d", &a, &b);
		data[a][b] = 1;
	}
	for (i = 1; i <= n; ++i) {
		for (j = 1; j <= n; ++j) {
			for (k = 1; k <= n; ++k) {
				if (data[j][i] && data[i][k]) data[j][k] = 1;
			}
		}
	}
	for (i = 1; i <= n; ++i) {
		flag = 0;
		for (j = 1; j <= n; ++j) {
			if (i == j) {
				if (flag) printf(" ");
				printf("%d",i); flag = 1;
			}
			if (i != j && data[i][j] && data[j][i]) {
				if (flag) printf(" ");
				printf("%d", j); flag = 1;
			}
		}
		printf("\n");
	}
	return 0;
}

```