#include <iostream>
#include <cmath>
#include <climits>
using namespace std;
double INF = 1e18;
int sgn(long long a){
if(a < 0) return -1;
else if(a == 0) return 0;
else return 1;
}
struct logNumber{
long long sign;
double value;
logNumber(int sign = 1, double value = 0){
this->sign = sign;
this->value = value;
}
void operator *= (long long a){
sign *= sgn(a);
if(sign == 0) value = 0;
else value += log(abs(a));
}
bool operator >(logNumber a){
return (sign > a.sign) or (sign == 1 and a.sign == 1 and value > a.value) or (sign == -1 and a.sign == -1 and value < a.value);
}
bool operator ==(logNumber a){
return sign == a.sign and value == a.value;
}
};
int main() {
cin.tie(NULL);
ios_base::sync_with_stdio(false);
int n,k;
cin>>n>>k;
logNumber mult[n];
for(int i =0; i < k; i++){
for(int j=0; j < n; j++){
long long temp;
cin>>temp;
mult[j] *= temp;
}
}
logNumber maxMult = mult[0];
int maxTeam = 0;
for(int i = 0; i < n; i++){
if (mult[i] > maxMult){
maxMult = mult[i];
maxTeam = i;
}
else if(mult[i]==maxMult){
maxTeam = max(i, maxTeam);
}
}
cout << maxTeam + 1;
return 0;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgojaW5jbHVkZSA8Y21hdGg+CiNpbmNsdWRlIDxjbGltaXRzPgoKdXNpbmcgbmFtZXNwYWNlIHN0ZDsKCmRvdWJsZSBJTkYgPSAxZTE4OwoKaW50IHNnbihsb25nIGxvbmcgYSl7CiAgICBpZihhIDwgMCkgcmV0dXJuIC0xOwogICAgZWxzZSBpZihhID09IDApIHJldHVybiAwOwogICAgZWxzZSByZXR1cm4gMTsKfQoKc3RydWN0IGxvZ051bWJlcnsKICAgIGxvbmcgbG9uZyBzaWduOwogICAgZG91YmxlIHZhbHVlOwogICAgbG9nTnVtYmVyKGludCBzaWduID0gMSwgZG91YmxlIHZhbHVlID0gMCl7CiAgICAgICAgdGhpcy0+c2lnbiA9IHNpZ247CiAgICAgICAgdGhpcy0+dmFsdWUgPSB2YWx1ZTsKICAgIH0KICAgIHZvaWQgb3BlcmF0b3IgKj0gKGxvbmcgbG9uZyBhKXsKICAgICAgICBzaWduICo9IHNnbihhKTsKICAgICAgICBpZihzaWduID09IDApIHZhbHVlID0gMDsKICAgICAgICBlbHNlIHZhbHVlICs9IGxvZyhhYnMoYSkpOwogICAgfQogICAgYm9vbCBvcGVyYXRvciA+KGxvZ051bWJlciBhKXsKICAgICAgICByZXR1cm4gKHNpZ24gPiBhLnNpZ24pIG9yICAoc2lnbiA9PSAxIGFuZCBhLnNpZ24gPT0gMSBhbmQgdmFsdWUgPiBhLnZhbHVlKSBvciAoc2lnbiA9PSAtMSBhbmQgYS5zaWduID09IC0xIGFuZCB2YWx1ZSA8IGEudmFsdWUpOwogICAgfQogICAgYm9vbCBvcGVyYXRvciA9PShsb2dOdW1iZXIgYSl7CiAgICAgICAgcmV0dXJuIHNpZ24gPT0gYS5zaWduIGFuZCB2YWx1ZSA9PSBhLnZhbHVlOwogICAgfQp9OwoKaW50IG1haW4oKSB7CiAgICBjaW4udGllKE5VTEwpOwogICAgaW9zX2Jhc2U6OnN5bmNfd2l0aF9zdGRpbyhmYWxzZSk7CiAgICBpbnQgbixrOwogICAgY2luPj5uPj5rOwogICAgbG9nTnVtYmVyIG11bHRbbl07CiAgICBmb3IoaW50IGkgPTA7IGkgPCBrOyBpKyspewogICAgICAgIGZvcihpbnQgaj0wOyBqIDwgbjsgaisrKXsKICAgICAgICAgICAgbG9uZyBsb25nIHRlbXA7CiAgICAgICAgICAgIGNpbj4+dGVtcDsKICAgICAgICAgICAgbXVsdFtqXSAqPSB0ZW1wOwogICAgICAgIH0KICAgIH0KICAgIGxvZ051bWJlciBtYXhNdWx0ID0gbXVsdFswXTsKICAgIGludCBtYXhUZWFtID0gMDsKICAgIGZvcihpbnQgaSA9IDA7IGkgPCBuOyBpKyspewogICAgICAgIGlmIChtdWx0W2ldID4gbWF4TXVsdCl7CiAgICAgICAgICAgIG1heE11bHQgPSBtdWx0W2ldOwogICAgICAgICAgICBtYXhUZWFtID0gaTsKICAgICAgICB9CiAgICAgICAgZWxzZSBpZihtdWx0W2ldPT1tYXhNdWx0KXsKICAgICAgICAgICAgbWF4VGVhbSA9IG1heChpLCBtYXhUZWFtKTsKICAgICAgICB9CiAgICB9CiAgICBjb3V0IDw8IG1heFRlYW0gKyAxOwoKCgoKICAgIHJldHVybiAwOwp9