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.OutputStream;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.InputMismatchException;
import java.io.InputStream;

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

class TaskD {
	public void solve(int testNumber, StreamInputReader in, PrintWriter out) {
        int N = in.nextInt();
        int M = in.nextInt();
        int[][] A = new int[N][M];
        for(int i = 0; i < N; i++)
            for(int j = 0; j < M; j++)
                A[i][j] = in.nextInt();

        boolean ok = false;
        int[] R = new int[N];
        int[] C = new int[M];
        while(!ok) {
            ok = true;
            // lines
            for(int i = 0; i < N; i++) {
                int sum = 0;
                for(int j = 0; j < M; j++)
                    sum += A[i][j];
                if(sum < 0) {
                    ok = false;
                    R[i]++;
                    for(int j = 0; j < M; j++)
                        A[i][j] = -A[i][j];
                }
            }

            // columns
            for(int j = 0; j < M; j++) {
                int sum = 0;
                for(int i = 0; i < N; i++)
                    sum += A[i][j];
                if(sum < 0) {
                    ok = false;
                    C[j]++;
                    for(int i = 0; i < N; i++)
                        A[i][j] = -A[i][j];
                }
            }
        }

        int a = 0;
        for(int i = 0; i < N; i++)
            a += R[i] % 2;
        out.print(a + " ");
        for(int i = 0; i < N; i++)
            if(R[i] % 2 == 1)
                out.print((i + 1) + " ");
        out.println();

        int b = 0;
        for(int j = 0; j < M; j++)
            b += C[j] % 2;
        out.print(b + " ");
        for(int j = 0; j < M; j++)
            if(C[j] % 2 == 1)
                out.print((j + 1) + " ");
	}
}

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

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

    public 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++];
    }

    }

abstract class InputReader {

    public abstract int read();

    public int nextInt() {
        return Integer.parseInt(nextString());
    }

    public String nextString() {
        int c = read();
        while (isSpaceChar(c))
            c = read();
        StringBuffer res = new StringBuffer();
        do {
            res.appendCodePoint(c);
            c = read();
        } while (!isSpaceChar(c));
        return res.toString();
    }

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

    }