
n=int(input())
l=[ list(map(int,input().split())) for i in range(n)]
l1=[]
for i in l:
    i=list(set(i))
    l1.append(i)

print(l1)
m=max(len(i) for i in l1 )
"""for i in l1:
    p=len(i)
    if p==m:
        print(l.index(i))
        """
print(l.index(max(l,key=lambda x:len(x))))

3de719b963743028f0373a1a3c0d49128f56fba8
<mask token>

<mask token>
for i in l:
    i = list(set(i))
    l1.append(i)
print(l1)
<mask token>
print(l.index(max(l, key=lambda x: len(x))))

n = int(input())
l = [list(map(int, input().split())) for i in range(n)]
l1 = []
for i in l:
    i = list(set(i))
    l1.append(i)
print(l1)
m = max(len(i) for i in l1)
<mask token>
print(l.index(max(l, key=lambda x: len(x))))


n=int(input())
l=[ list(map(int,input().split())) for i in range(n)]
l1=[]
for i in l:
    i=list(set(i))
    l1.append(i)

print(l1)
m=max(len(i) for i in l1 )
"""for i in l1:
    p=len(i)
    if p==m:
        print(l.index(i))
        """
print(l.index(max(l,key=lambda x:len(x))))
