#include <bits/stdc++.h>

using namespace std;

typedef long long ll;
typedef pair<int, int> pi;

#define int ll
#define pb push_back
#define pf push_front
#define in insert
#define f first
#define s second

mt19937_64 rnd;

const int inf = 1e17, N = 4e5, mod = 1e9 + 7;

signed main(){
  int n, m, g;
  cin >> n >> m >> g;
  vector<pi> br(m);
  for(int i = 0; i < m; i++) cin >> br[i].f >> br[i].s;
  cout << n - 1 << " 0";
  return 0;
}