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 T>
void checkmin(T &t, T x) {
  if (x < t) t = x;
}
template <class T>
void checkmax(T &t, T x) {
  if (x > t) t = x;
}
template <class T>
void _checkmin(T &t, T x) {
  if (t == -1) t = x;
  if (x < t) t = x;
}
template <class T>
void _checkmax(T &t, T x) {
  if (t == -1) t = x;
  if (x > t) t = x;
}
const int N = 105;
int m, n;
int sumx[N];
int sumy[N];
int a[N][N];
int retx[N], rety[N];
int main() {
  scanf("%d%d", &m, &n);
  for (int i = 1; i <= m; i++) {
    for (int j = 1; j <= n; j++) {
      scanf("%d", &a[i][j]);
      sumx[i] += a[i][j];
      sumy[j] += a[i][j];
    }
  }
  fill(retx, retx + m + 1, 1);
  fill(rety, rety + n + 1, 1);
  for (;;) {
    bool flag = 0;
    for (int i = 1; i <= m; i++) {
      if (sumx[i] < 0) {
        sumx[i] = -sumx[i];
        for (int j = 1; j <= n; j++) {
          sumy[j] -= 2 * retx[i] * rety[j] * a[i][j];
        }
        retx[i] = -retx[i];
        flag = 1;
      }
    }
    for (int j = 1; j <= n; j++) {
      if (sumy[j] < 0) {
        sumy[j] = -sumy[j];
        for (int i = 1; i <= m; i++) {
          sumx[i] -= 2 * retx[i] * rety[j] * a[i][j];
        }
        rety[j] = -rety[j];
        flag = 1;
      }
    }
    if (!flag) break;
  }
  vector<int> vx, vy;
  for (int i = 1; i <= m; i++) {
    if (retx[i] == -1) {
      vx.push_back(i);
    }
  }
  for (int i = 1; i <= n; i++) {
    if (rety[i] == -1) {
      vy.push_back(i);
    }
  }
  printf("%d", vx.size());
  for (__typeof((vx).begin()) it = (vx).begin(); it != (vx).end(); it++) {
    printf(" %d", *it);
  }
  puts("");
  printf("%d", vy.size());
  for (__typeof((vy).begin()) it = (vy).begin(); it != (vy).end(); it++) {
    printf(" %d", *it);
  }
  puts("");
}