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;
void read(long long &x) {
  x = 0;
  char c = getchar();
  int f = 1;
  while (c < '0' || c > '9') {
    if (c == '-') f = -f;
    c = getchar();
  }
  while (c >= '0' && c <= '9') {
    x = (x << 3) + (x << 1) + c - '0';
    c = getchar();
  }
  x *= f;
  return;
}
long long maxt(long long a, long long b) { return a > b ? a : b; }
long long mint(long long a, long long b) { return a < b ? a : b; }
void write(long long x) {
  if (x < 0) {
    putchar('-');
    x = -x;
  }
  if (x < 10) {
    putchar('0' + x);
    return;
  }
  write(x / 10);
  putchar(x % 10 + '0');
  return;
}
bool vis1[105], vis2[105], vis3[105], vis4[105];
long long n, m, tot, s[105][105], c[105], r[105], ans1, ans2, a1[105], a2[105];
bool check() {
  for (int i = 1; i <= n; i++)
    if (r[i] < 0) return 1;
  for (int j = 1; j <= m; j++)
    if (c[j] < 0) return 1;
  return 0;
}
int main() {
  read(n), read(m);
  long long p = 0;
  for (int i = 1; i <= n; i++)
    for (int j = 1; j <= m; j++)
      read(s[i][j]), tot += fabs(s[i][j]) * 2, r[i] += s[i][j];
  for (int j = 1; j <= m; j++)
    for (int i = 1; i <= n; i++) c[j] += s[i][j];
  p = -tot;
  long long i = 1, j = 1, tot1 = 0;
  while (check()) {
    bool f = 0;
    while (i <= n) {
      if (r[i] < 0) {
        vis1[i] = !vis1[i];
        a1[++ans1] = i;
        p += -4 * r[i];
        r[i] = -r[i];
        for (int k = 1; k <= m; k++) {
          c[k] -= 2 * s[i][k];
          s[i][k] = -s[i][k];
        }
        f = 1;
        tot1 = 0;
        break;
      }
      i++;
    }
    while (j <= m && !f) {
      if (c[j] < 0) {
        vis2[j] = !vis2[j];
        a2[++ans2] = j;
        p += -4 * c[j];
        c[j] = -c[j];
        for (int k = 1; k <= n; k++) {
          r[k] -= 2 * s[k][j];
          s[k][j] = -s[k][j];
        }
        f = 1;
        tot1 = 0;
        break;
      }
      j++;
    }
    if (!f) tot1++;
    if (tot1 > 1) break;
    if (i > n && j > m) {
      i = 1;
      j = 1;
    }
  }
  long long p1 = 0;
  for (int i = 1; i <= ans1; i++)
    if (vis1[a1[i]]) p1++, vis1[a1[i]] = 0, vis3[i] = 1;
  write(p1);
  for (int i = 1; i <= ans1; i++)
    if (vis3[i]) {
      putchar(' ');
      write(a1[i]);
    }
  putchar('\n');
  long long p2 = 0;
  for (int i = 1; i <= ans2; i++)
    if (vis2[a2[i]]) p2++, vis2[a2[i]] = 0, vis4[i] = 1;
  write(p2);
  for (int i = 1; i <= ans2; i++)
    if (vis4[i]) {
      putchar(' ');
      write(a2[i]);
    }
}