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 JAVA):

Solution:
import java.io.IOException;
import java.io.OutputStreamWriter;
import java.util.Arrays;
import java.io.BufferedWriter;
import java.util.InputMismatchException;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.io.Writer;
import java.math.BigInteger;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 * @author Crash
 */
public class Main {
	public static void main(String[] args) {
		InputStream inputStream = System.in;
		OutputStream outputStream = System.out;
		InputReader in = new InputReader(inputStream);
		OutputWriter out = new OutputWriter(outputStream);
		TaskD solver = new TaskD();
		solver.solve(1, in, out);
		out.close();
	}
}

class TaskD {
	public void solve(int testNumber, InputReader in, OutputWriter out) {
		int n = in.readInt();
		int m = in.readInt();
		int[][] a = in.readIntArray(n, m);
		int[] row = new int[n];
		int[] column = new int[m];
		Arrays.fill(row, 0);
		Arrays.fill(column, 0);
		for (int i = 0; i < n; i ++)
			for (int j = 0; j < m; j ++) {
				row[i] += a[i][j];
				column[j] += a[i][j];
			}
		boolean[] a1 = new boolean[n];
		boolean[] a2 = new boolean[m];
		Arrays.fill(a1, false);
		Arrays.fill(a2, false);
		while (true) {
			boolean flag = false;
			for (int i = 0; i < n; i ++)
				if (row[i] < 0) {
					flag = true;
					row[i] *= -1;
					for (int j = 0; j < m; j ++) {
						column[j] -= a[i][j];
						a[i][j] *= -1;
						column[j] += a[i][j];
					}
					a1[i] = ! a1[i];
					break;
				}
			if (flag) continue;
			for (int j = 0; j < m; j ++)
				if (column[j] < 0) {
					flag = true;
					column[j] *= -1;
					for (int i = 0; i < n; i ++) {
						row[i] -= a[i][j];
						a[i][j] *= -1;
						row[i] += a[i][j];
					}
					a2[j] = ! a2[j];
					break;
				}
			if (! flag) break;
		}
		int cnt1 = 0;
		for (int i = 0; i < n; i ++)
			if (a1[i]) cnt1 ++;
		out.print(cnt1);
		for (int i = 0; i < n; i ++)
			if (a1[i]) out.print(" " + (i + 1));
		out.printLine();
		int cnt2 = 0;
		for (int i = 0; i < m; i ++)
			if (a2[i]) cnt2 ++;
		out.print(cnt2);
		for (int i = 0; i < m; i ++)
			if (a2[i]) out.print(" " + (i + 1));
		out.printLine();
	}
}

class InputReader {
	private InputStream stream;
	private byte[] buf = new byte[1000];
	private int curChar;
	private int numChars;

	public InputReader(InputStream stream) {
		this.stream = stream;
	}

	private int read() {
		if (numChars == -1)
			throw new InputMismatchException();
		if (curChar >= numChars) {
			curChar = 0;
			try {
				numChars = stream.read(buf);
			} catch (IOException e) {
				throw new InputMismatchException();
			}
			if (numChars <= 0)
				return -1;
		}
		return buf[curChar++];
	}

	public int readInt() {
		int c = read();
		while (isSpaceChar(c))
			c = read();
		int sgn = 1;
		if (c == '-') {
			sgn = -1;
			c = read();
		}
		int res = 0;
		do {
			if (c < '0' || c > '9')
				throw new InputMismatchException();
			res *= 10;
			res += c - '0';
			c = read();
		} while (!isSpaceChar(c));
		return res * sgn;
	}

	public int[][] readIntArray(int n, int m) {
		int[][] res = new int[n][m];
		for (int i = 0; i < n; i ++)
			for (int j = 0; j < m; j ++)
				res[i][j] = readInt();
		return res;
	}

	private boolean isSpaceChar(int c) {
		return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
	}
}

class OutputWriter {
	private final PrintWriter writer;

	public OutputWriter(OutputStream outputStream) {
		writer = new PrintWriter(new BufferedWriter(new OutputStreamWriter(outputStream)));
	}

	public OutputWriter(Writer writer) {
		this.writer = new PrintWriter(writer);
	}

	public void print(Object...objects) {
		for (int i = 0; i < objects.length; i++) {
			if (i != 0)
				writer.print(' ');
			writer.print(objects[i]);
		}
	}

	public void printLine(Object...objects) {
		print(objects);
		writer.println();
	}

	public void close() {
		writer.close();
	}
}