#include
#define MAX 100
void main()
{int mas[MAX][MAX], n, m, i, j, k, ok;
scanf("%d%d", &n, &m);
for (i=0; i for (j=0; j scanf("%d", &mas[i][j]);
for (i=0; i for (j=i+1; j {ok=1;
for (k=0; k if (mas[i][k]==mas[j][k])
{ok=0;
break;}
if (ok)
printf("%d %d\n", i, j);}}