class Bird: def __init__(self,type): self.birdType = type self.count = 0 def inc(self): self.count = self.count + 1 n = input() l = [] l = raw_input().split() t = [Bird(1) , Bird(2) , Bird(3) , Bird(4) , Bird(5)] for i in xrange(n) : if l[i] == "1": t[0].inc() elif l[i] == "2": t[1].inc() elif l[i] == "3": t[2].inc() elif l[i] == "4": t[3].inc() elif l[i] == "5": t[4].inc() max = 0 type = 1 for i in xrange(5): if t[i].count >max: max = t[i].count type = t[i].birdType print type