//#pragma GCC optimize("O3")
//#pragma GCC target("avx, avx2")
#include<bits/stdc++.h>
#include<ext/pb_ds/assoc_container.hpp>
#include<ext/pb_ds/tree_policy.hpp>
#define ALL(X) (X).begin(), (X).end()
#define sz(X) (int)(X.size())

using namespace std;
using namespace __gnu_pbds;

typedef long long ll;
typedef unsigned int ui;
typedef long double ld;

#define ordered_set tree<int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update>

int main() {
	ios_base::sync_with_stdio(0);
	cin.tie(0);
	int n, m, group;
	cin >> n >> m >> group;
	vector<vector<int>> g(m);
	for (int i = 0; i < m; ++i) {
		int u, v;
		cin >> u >> v;
		--u; --v;
		g[u].emplace_back(v);
	}
	cout << 1 << "\n" << 0 << "\n";	
	return 0;
}