Problem: Harry Potter has a difficult homework. Given a rectangular table, consisting of n × m cells. Each cell of the table contains the integer. Harry knows how to use two spells: the first spell change the sign of the integers in the selected row, the second — in the selected column. Harry's task is to make non-negative the sum of the numbers in each row and each column using these spells.

Alone, the boy can not cope. Help the young magician!

Input

The first line contains two integers n and m (1 ≤ n, m ≤ 100) — the number of rows and the number of columns. 

Next n lines follow, each contains m integers: j-th integer in the i-th line is ai, j (|ai, j| ≤ 100), the number in the i-th row and j-th column of the table.

The rows of the table numbered from 1 to n. The columns of the table numbered from 1 to m.

Output

In the first line print the number a — the number of required applications of the first spell. Next print a space-separated integers — the row numbers, you want to apply a spell. These row numbers must be distinct!

In the second line print the number b — the number of required applications of the second spell. Next print b space-separated integers — the column numbers, you want to apply a spell. These column numbers must be distinct!

If there are several solutions are allowed to print any of them.

Examples

Input

4 1
-1
-1
-1
-1


Output

4 1 2 3 4 
0 


Input

2 4
-1 -1 -1 2
1 1 1 1


Output

1 1 
1 4 

Solution (in CPP):

Solution:
#include <bits/stdc++.h>
using namespace std;
template <class F, class T>
T convert(F a, int p = -1) {
  stringstream ss;
  if (p >= 0) ss << fixed << setprecision(p);
  ss << a;
  T r;
  ss >> r;
  return r;
}
template <class T>
void db(T a, int p = -1) {
  if (p >= 0) cout << fixed << setprecision(p);
  cout << a << " ";
}
template <class T>
T gcd(T a, T b) {
  T r;
  while (b != 0) {
    r = a % b;
    a = b;
    b = r;
  }
  return a;
}
template <class T>
T lcm(T a, T b) {
  return a / gcd(a, b) * b;
}
template <class T>
T sqr(T x) {
  return x * x;
}
template <class T>
T cube(T x) {
  return x * x * x;
}
template <class T>
struct Triple {
  T x, y, z;
  Triple() {}
  Triple(T _x, T _y, T _z) : x(_x), y(_y), z(_z) {}
};
template <class T>
Triple<T> euclid(T a, T b) {
  if (b == 0) return Triple<T>(1, 0, a);
  Triple<T> r = euclid(b, a % b);
  return Triple<T>(r.y, r.x - a / b * r.y, r.z);
}
template <class T>
int getbit(T s, int i) {
  return (s >> i) & 1;
}
template <class T>
T onbit(T s, int i) {
  return s | (T(1) << i);
}
template <class T>
T offbit(T s, int i) {
  return s & (~(T(1) << i));
}
template <class T>
int cntbit(T s) {
  return s == 0 ? 0 : cntbit(s >> 1) + (s & 1);
}
const int bfsz = 1 << 16;
char bf[bfsz + 5];
int rsz = 0;
int ptr = 0;
char gc() {
  if (rsz <= 0) {
    ptr = 0;
    rsz = fread(bf, 1, bfsz, stdin);
    if (rsz <= 0) return EOF;
  }
  --rsz;
  return bf[ptr++];
}
void ga(char &c) {
  c = EOF;
  while (!isalpha(c)) c = gc();
}
int gs(char s[]) {
  int l = 0;
  char c = gc();
  while (isspace(c)) c = gc();
  while (c != EOF && !isspace(c)) {
    s[l++] = c;
    c = gc();
  }
  s[l] = '\0';
  return l;
}
template <class T>
bool gi(T &v) {
  v = 0;
  char c = gc();
  while (c != EOF && c != '-' && !isdigit(c)) c = gc();
  if (c == EOF) return false;
  bool neg = c == '-';
  if (neg) c = gc();
  while (isdigit(c)) {
    v = v * 10 + c - '0';
    c = gc();
  }
  if (neg) v = -v;
  return true;
}
const double PI = 2 * acos(0);
const string months[] = {"January",   "February", "March",    "April",
                         "May",       "June",     "July",     "August",
                         "September", "October",  "November", "December"};
const int days[] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
const int dr[] = {0, 0, -1, +1};
const int dc[] = {-1, +1, 0, 0};
const int inf = (int)1e9 + 5;
const long long linf = (long long)1e16 + 5;
const double eps = double(1e-9);
long long mod, l, r, len;
int a[1005][1005], row[1005], col[1005], flagr[1005], flagc[1005];
int n, m;
void Doih(int num) {
  row[num] = -row[num];
  for (__typeof(m) i = (1); i <= (m); ++i) {
    col[i] -= 2 * a[num][i];
    a[num][i] = -a[num][i];
  }
  flagr[num] = 1 - flagr[num];
}
void Doic(int num) {
  col[num] = -col[num];
  for (__typeof(n) i = (1); i <= (n); ++i) {
    row[i] -= 2 * a[i][num];
    a[i][num] = -a[i][num];
  }
  flagc[num] = 1 - flagc[num];
}
int main() {
  memset(row, 0, sizeof(row));
  memset(col, 0, sizeof(col));
  memset(flagr, 0, sizeof(flagr));
  memset(flagc, 0, sizeof(flagc));
  scanf("%d %d", &n, &m);
  for (__typeof(n) i = (1); i <= (n); ++i)
    for (__typeof(m) j = (1); j <= (m); ++j) {
      scanf("%d", &a[i][j]);
      row[i] += a[i][j];
      col[j] += a[i][j];
    }
  int num, id;
  while (true) {
    num = -1;
    id = -1;
    int MIN = 0;
    for (__typeof(n) i = (1); i <= (n); ++i)
      if (row[i] < MIN) {
        num = i;
        id = 0;
        MIN = row[i];
      }
    for (__typeof(m) i = (1); i <= (m); ++i)
      if (col[i] < MIN) {
        num = i;
        id = 1;
        MIN = col[i];
      }
    if (num == -1)
      break;
    else if (id == 0)
      Doih(num);
    else
      Doic(num);
  }
  vector<int> V1, V2;
  for (__typeof(n) i = (1); i <= (n); ++i) {
    if (flagr[i]) V1.push_back(i);
  }
  for (__typeof(m) i = (1); i <= (m); ++i)
    if (flagc[i]) V2.push_back(i);
  printf("%d", ((int)(V1).size()));
  for (__typeof(((int)(V1).size())) i = 0; i < (((int)(V1).size())); ++i)
    printf(" %d", V1[i]);
  puts("");
  printf("%d", ((int)(V2).size()));
  for (__typeof(((int)(V2).size())) i = 0; i < (((int)(V2).size())); ++i)
    printf(" %d", V2[i]);
}