#define NOFOOTER

#include "my_testlib.h"

#define forn(i, n) for (int i = 0; i < (int)(n); i++)

const int N = 1000;
const int D = 10;
const int C = (int)1e4;

int main(int, char *[])
{
  registerValidation();

  int n = inf.readInt(1, N);
  inf.readSpace();
  int d = inf.readInt(1, D);
  inf.readEoln();
  forn(i, n)
  {
    int good = 0;
    forn(j, d)
    {
      good |= inf.readInt(-C, C);
      if (j == d - 1)
        inf.readEoln();
      else
        inf.readSpace();
    }
    ensure(good);
  }
  inf.readEof();
  return 0;
}
