n = io.read("*number", "*l") types = {} types_temp = io.read() types_i = 1; for token in string.gmatch(types_temp, "[^%s]+") do types[types_i] = tonumber(token) types_i = types_i + 1 end x = 1 TypeC = {0, 0, 0, 0, 0} repeat TypeC[types[x]] = TypeC[types[x]]+1 x = x+1 until x == n+1 a = 5 x = 4 repeat if TypeC[x] >= TypeC[a] then a = x end x = x-1 until x == 0 print(a)