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.*;

import static java.lang.Math.*;
import java.util.*;
import static java.util.Arrays.fill;
import static java.util.Arrays.sort;

public class Main {
	public static void main(String[] args) {
		if(new File("input.txt").exists())
			try {
				System.setIn(new FileInputStream("input.txt"));
			} catch (FileNotFoundException e1) {
				e1.printStackTrace();
			}
		new Thread(null, new Runnable() {
			public void run() {
				try {
					new Main().run();
				} catch (IOException e) {
					e.printStackTrace();
				}
			}
		}, "kek", 1 << 23).start();
	}

	BufferedReader in;
	PrintWriter out;
	StringTokenizer st = new StringTokenizer("");
	
	
	void run() throws IOException {
		in = new BufferedReader(new InputStreamReader(System.in));
		out = new PrintWriter(System.out);
		Locale.setDefault(Locale.US);
		solve();
		in.close();
		out.close();
	}


	TreeSet<Event> ts = new TreeSet<Event>();
	
	Event[] addedRow;
	Event[] addedCol;
	void solve() throws IOException{
		int n = nextInt();
		int m = nextInt();
		int map[][] = new int[n][m];
		addedRow = new Event[n];
		addedCol = new Event[m];

		boolean revRow[] = new boolean[n];
		boolean revCol[] = new boolean[m];
		
		int sumRow[] = new int[n];
		int sumCol[] = new int[m];
		
		for(int i = 0; i < n; i++)
			for(int j = 0; j < m; j++){
				map[i][j] = nextInt();
				sumCol[j] += map[i][j];
				sumRow[i] += map[i][j];
			}
		for(int i = 0; i < n; i++)
			if(sumRow[i] < 0) ts.add(addedRow[i] = new Event(-sumRow[i], i, true));
		for(int j = 0; j < m; j++)
			if(sumCol[j] < 0) ts.add(addedCol[j] = new Event(-sumCol[j], j, false));
		
		
		while(true){
			while(!ts.isEmpty()){
	//			System.err.println(Arrays.toString(sumRow));
	//			System.err.println(Arrays.toString(sumCol));
				Event e = ts.pollFirst();
	//			System.err.println("it");
				if(e.type){
					int r = e.id;
	//				System.err.println("row " + r + " | " + e.sum);
					addedRow[r] = null;
					if(sumRow[r] >= 0) continue;
					revRow[r] = !revRow[r];
					sumRow[r] = -sumRow[r];
					for(int j = 0; j < m; j++){
						if(addedCol[j] != null){ ts.remove(addedCol[j]); addedCol[j] = null; }
						sumCol[j] += (revRow[r] ^ revCol[j]) ? ( - 2 * map[r][j]) : ( + 2 * map[r][j]);
						if(sumCol[j] < 0) ts.add(addedCol[j] = new Event(-sumCol[j], j, false));
					}
				} else {
					int c = e.id;
	//				System.err.println("col " + c + " | " + e.sum);
					addedCol[c] = null;
					if(sumCol[c] >= 0) continue;
					revCol[c] = !revCol[c];
					sumCol[c] = -sumCol[c];
					for(int i = 0; i < n; i++){
						if(addedRow[i] != null){ ts.remove(addedRow[i]); addedRow[i] = null; }
						sumRow[i] += (revCol[c] ^ revRow[i]) ? ( - 2 * map[i][c]) : ( + 2 * map[i][c]);
						if(sumRow[i] < 0) ts.add(addedRow[i] = new Event(-sumRow[i], i, true));
					}
				}
			}
			for(int i = 0; i < n; i++)
				if(sumRow[i] < 0)
					ts.add(addedRow[i] = new Event(-sumRow[i], i, true));
				else
					addedRow[i] = null;
			for(int j = 0; j < m; j++)
				if(sumCol[j] < 0)
					ts.add(addedCol[j] = new Event(-sumCol[j], j, false));
				else
					addedCol[j] = null;
			if(ts.isEmpty()) break;
		}
		
//		for(int i = 0; i < n; i++){
//			int sum = 0;
//			for(int j = 0; j < m; j++)
//				sum += ((revRow[i] ^ revCol[j]) ? (-1) : 1) * map[i][j];
//			if(sum != sumRow[i]) throw new RuntimeException();
//		}
//		
//		for(int j = 0; j < m; j++){
//			int sum = 0;
//			for(int i = 0; i < n; i++)
//				sum += ((revRow[i] ^ revCol[j]) ? (-1) : 1) * map[i][j];
//			if(sum != sumCol[j]) for(;;);
//		}
		
		ArrayList<Integer> ansRow = new ArrayList<Integer>();
		for(int i = 0; i < n; i++)
			if(revRow[i]) ansRow.add(i + 1);
		out.print(ansRow.size());
		for(int a : ansRow)
			out.print(" " + a);
		out.println();
		
		ArrayList<Integer> ansCol = new ArrayList<Integer>();
		for(int j = 0; j < m; j++)
			if(revCol[j]) ansCol.add(j + 1);
		out.print(ansCol.size());
		for(int a : ansCol)
			out.print(" " + a);
		out.println();
		
		
	}
	
	class Event implements Comparable<Event>{
		int sum, id;
		boolean type;
		Event(int a, int b, boolean f){
			sum = a;
			id = b;
			type = f;
		}
		@Override
		public int compareTo(Event e) {
			return (sum != e.sum) ? (e.sum - sum) : (id - e.id);
		}
	}
	
	
	String nextToken() throws IOException{
		while(!st.hasMoreTokens())
			st = new StringTokenizer(in.readLine());
		return st.nextToken();
	}
	int nextInt() throws IOException{
		return Integer.parseInt(nextToken());
	}
	double nextDouble() throws IOException{
		return Double.parseDouble(nextToken());
	}
}