# 2. 题解

#include <bits/stdc++.h>

#define NS (1005)
#define MS (2005)

using namespace std;

template <typename _Tp> inline void IN(_Tp& dig)
{
char c; bool flag = 0; dig = 0;
while (c = getchar(), !isdigit(c)) if (c == '-') flag = 1;
while (isdigit(c)) dig = dig * 10 + c - '0', c = getchar();
if (flag) dig = -dig;
}

int n, m, ans, res[NS];

bitset<NS> h[MS];

char str[NS];

void GS()
{
for (int i = 1; i <= n; i += 1)
{
for (int j = i; j <= m; j += 1)
if (h[j][i])
{
ans = max(ans, j);
if (i != j) swap(h[i], h[j]);
break;
}
if (!h[i][i]) puts("Cannot Determine"), exit(0);
for (int j = i + 1; j <= m; j += 1)
if (h[j][i]) h[j] ^= h[i];
}
for (int i = n; i >= 1; i -= 1)
{
res[i] = h[i][n + 1];
for (int j = i + 1; j <= n; j += 1)
if (h[i][j]) res[i] ^= res[j];
}
}

int main(int argc, char const* argv[])
{
IN(n), IN(m);
for (int i = 1; i <= m; i += 1)
{
scanf("%s", str + 1);
for (int j = 1; j <= n; j += 1) if (str[j] == '1') h[i].set(j, 1);
scanf("%s", str);
if (str[0] == '1') h[i].set(n + 1, 1);
}
GS(), printf("%d\n", ans);
for (int i = 1; i <= n; i += 1)
if (res[i]) puts("?y7M#");
else puts("Earth");
return 0;
}