#include <bits/stdc++.h>
using namespace std;
int n, m, Y[233], X[233];;
int main()
{
freopen("asm_report.in", "r", stdin);
#ifndef debug
freopen("asm_report.out", "w", stdout);
#endif
scanf("%d%d", &n, &m);
for (int i = 0; i < m; ++i) scanf("%d%d", X + i, Y + i);
int ans = -1;
for (int s = 0; s < (1 << n); ++s)
{
bool flag = true;
for (int i = 0; i < m; ++i) flag &=
(X[i] > 0 ? s >> (X[i] - 1) & 1: ~s >> (-X[i] - 1) & 1) ||
(Y[i] > 0 ? s >> (Y[i] - 1) & 1: ~s >> (-Y[i] - 1) & 1);
if (flag) { ans = s; break; }
}
for (int i = 0; i < n; ++i)
printf("%c%c", "01"[ans >> i & 1], " \n"[i == n - 1]);
}