#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  cin >> N;
  int M;
  cin >> M;
  int count;
  count = 0;
  int s[M - 1], c[M - 1];
  while (count < M) {
    cin >> s[count] >> c[count];
    count++;
  }
  cout << -1 << endl;
}
