string[] nm = Console.ReadLine().Split(' ');
int n = Convert.ToInt32(nm[0]);
int m = Convert.ToInt32(nm[1]);
int[][] h = new int[n][];
for (int i = 0; i < n; i++){
string[] line = Console.ReadLine().Split(' ');
for (int j = 0;j<line.Length;j++){
h[i] = new int[m];
h[i][j] = Convert.ToInt32(line[j]);
}
}
Console.WriteLine();
int sor=0;
int max=h[0][0];
for (int i = 0; i < n; i++)
{
for (int j = 0; j < m; j++)
{
if(max < h[i][j]){
sor=i;
max=h[i][j];
}
}
}
int min = h[sor][0];
for (int i = 0; i < m; i++)
{
if(h[sor][i]<min){
min = h[sor][i];
}
}
Console.WriteLine("{0}", min);
int db = 0;
List<int> k = new List<int>();
for (int i = 0; i < m; i++)
{
if(h[sor][i] == min){
db++;
k.Add(i);
}
}
//k=k.Select(x => x+1).ToList();
Console.WriteLine("{0} {1}",db,string.Join(" ",k));