#include using namespace std; using ll = long long int; int main(){ ll N,M; cin >> N >> M; for(ll i = 0;i < M;i++){ ll a,b; cin >> a >> b; if(a != 1 && b != 1){ cout << -1 << endl; return 0; } } for(ll i = 0;i < N;i++){ cout << "1" << " \n"[i == N - 1]; } }