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;
struct debugger {
  template <typename T>
  debugger& operator,(const T& v) {
    cerr << v << "\t";
    return *this;
  }
} dbg;
template <class T>
void setmax(T& a, T b) {
  if (a < b) a = b;
}
template <class T>
void setmin(T& a, T b) {
  if (b < a) a = b;
}
template <class T>
T Abs(T x) {
  return x > 0 ? x : -x;
}
template <class T>
inline T sqr(T x) {
  return x * x;
}
template <class T>
inline T Mod(T n, T m) {
  return (n % m + m) % m;
}
template <class T>
string toString(T n) {
  ostringstream oss;
  oss << n;
  oss.flush();
  return oss.str();
}
long long toInt(string s) {
  long long r = 0;
  istringstream sin(s);
  sin >> r;
  return r;
}
bool isVowel(char ch) {
  ch = tolower(ch);
  if (ch == 'a' || ch == 'e' || ch == 'i' || ch == 'o' || ch == 'u')
    return true;
  return false;
}
bool isUpper(char c) { return c >= 'A' && c <= 'Z'; }
bool isLower(char c) { return c >= 'a' && c <= 'z'; }
long long Pow(long long B, long long P) {
  long long R = 1;
  while (P > 0) {
    if (P % 2 == 1) R = (R * B);
    P /= 2;
    B = (B * B);
  }
  return R;
}
long long BigMod(long long B, long long P, long long M) {
  long long R = 1;
  while (P > 0) {
    if (P % 2 == 1) {
      R = (R * B) % M;
    }
    P /= 2;
    B = (B * B) % M;
  }
  return R;
}
void binprint(long long mask, long long n) {
  long long i;
  string s = "";
  do {
    s += (mask % 2 + '0');
    mask /= 2;
  } while (mask);
  reverse(s.begin(), s.end());
  s = string(max(n - (int)s.size(), 0LL), '0') + s;
  for (i = (int)s.size() - n; i < (int)s.size(); i++) printf("%c", s[i]);
  printf("\n");
}
void ASCII_Chart() {
  long long i, j, k;
  printf("ASCII Chart:(30-129)\n");
  for (i = 30; i < 50; i++) {
    for (j = 0; j < 5; j++) {
      k = i + j * 20;
      printf("%3d---> '%c'   ", k, k);
    }
    printf("\n");
  }
}
int tab[100][100], row[100], col[100];
int main() {
  int i, j, test, Case = 1, n, m, a, b, sum, ks;
  while (cin >> n >> m) {
    test = 1;
    memset(row, 0, sizeof(row));
    memset(col, 0, sizeof(col));
    for (i = 0; i < n; i++)
      for (j = 0; j < m; j++) scanf("%d", &tab[i][j]);
    ks = 1;
    while (test) {
      test = 0;
      for (i = 0; i < n; i++) {
        sum = 0;
        for (j = 0; j < m; j++) sum += tab[i][j];
        if (sum < 0) {
          for (j = 0; j < m; j++) tab[i][j] = -tab[i][j];
          row[i]++;
        }
        if (sum < 0) test = 1;
      }
      for (j = 0; j < m; j++) {
        sum = 0;
        for (i = 0; i < n; i++) sum += tab[i][j];
        if (sum < 0) {
          for (i = 0; i < n; i++) tab[i][j] = -tab[i][j];
          col[j]++;
        }
        if (sum < 0) test = 1;
      }
    }
    a = b = 0;
    for (i = 0; i < n; i++)
      if (row[i] & 1) a++;
    for (i = 0; i < m; i++)
      if (col[i] & 1) b++;
    cout << a;
    for (i = 0; i < n; i++)
      if (row[i] & 1) cout << " " << i + 1;
    cout << endl;
    cout << b;
    for (i = 0; i < m; i++)
      if (col[i] & 1) cout << " " << i + 1;
    cout << endl;
  }
  return 0;
}