#include <iostream>
#include <vector>
#include <array>
#include <string>
#include <stack>
#include <queue>
#include <deque>
#include <map>
#include <set>
#include <tuple>
#include <bitset>
#include <memory>
#include <cmath>
#include <algorithm>
#include <functional>
#include <iomanip>
#include <numeric>
#include <climits>
#include <cfloat>
#include <random>

int main() {
	int n, m; std::cin >> n >> m;
	std::vector<std::vector<int>> node(n);
	for (auto i = 0; i < m; ++i) {
		int a, b; std::cin >> a >> b; --a; --b;
		node[a].push_back(b);
	}
	std::vector<std::vector<bool>> can_reach(n, std::vector<bool>(n, false));
	std::queue<std::pair<int, int>> queue;
	for (auto i = 0; i < n; ++i) {
		queue.emplace(i, i);
		can_reach[i][i] = true;
	}
	while (!queue.empty()) {
		auto top = queue.front(); queue.pop();
		for (const auto next : node[top.second]) if (!can_reach[top.first][next]) {
			queue.emplace(top.first, next);
			can_reach[top.first][next] = true;
		}
	}
	for (auto i = 0; i < n; ++i) {
		bool first = true;
		for (auto j = 0; j < n; ++j) if (can_reach[i][j] && can_reach[j][i]) {
			if (!first) std::cout << ' ';
			std::cout << j + 1;
			first = false;
		}
		std::cout << '\n';
	}
}


### 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 <iostream>
#include <vector>
#include <array>
#include <string>
#include <stack>
#include <queue>
#include <deque>
#include <map>
#include <set>
#include <tuple>
#include <bitset>
#include <memory>
#include <cmath>
#include <algorithm>
#include <functional>
#include <iomanip>
#include <numeric>
#include <climits>
#include <cfloat>
#include <random>

int main() {
	int n, m; std::cin >> n >> m;
	std::vector<std::vector<int>> node(n);
	for (auto i = 0; i < m; ++i) {
		int a, b; std::cin >> a >> b; --a; --b;
		node[a].push_back(b);
	}
	std::vector<std::vector<bool>> can_reach(n, std::vector<bool>(n, false));
	std::queue<std::pair<int, int>> queue;
	for (auto i = 0; i < n; ++i) {
		queue.emplace(i, i);
		can_reach[i][i] = true;
	}
	while (!queue.empty()) {
		auto top = queue.front(); queue.pop();
		for (const auto next : node[top.second]) if (!can_reach[top.first][next]) {
			queue.emplace(top.first, next);
			can_reach[top.first][next] = true;
		}
	}
	for (auto i = 0; i < n; ++i) {
		bool first = true;
		for (auto j = 0; j < n; ++j) if (can_reach[i][j] && can_reach[j][i]) {
			if (!first) std::cout << ' ';
			std::cout << j + 1;
			first = false;
		}
		std::cout << '\n';
	}
}


```