from collections import Counter input() c = Counter(input()) ma = 0 lv ='' for l in '123456': if c[l] >= ma: ma = c[l] lv = l print(int(lv))