#include <iostream>
using namespace std;
int main()
{
int v[100][100],i,j,p,m;
cout<<"p="; cin>>p;
cout<<"m="; cin>>m;
for(i=1;i<=p;i++)
for(j=1;j<=m;j++)
cin>>v[i][j];
int min;
for(i=1;i<=p;i++)
{
min=v[i][1];
for(j=2;j<=m;j++)
if(v[i][j]<min)
min=v[i][j];
for(j=1;j<=m;j++)
if(v[i][j]==min)
cout<<j<<endl;
}
return 0;
}