process.stdin.resume(); process.stdin.setEncoding('ascii'); var input_stdin = ""; var input_stdin_array = ""; var input_currentline = 0; process.stdin.on('data', function (data) { input_stdin += data; }); process.stdin.on('end', function () { input_stdin_array = input_stdin.split("\n"); main(); }); function readLine() { return input_stdin_array[input_currentline++]; } /////////////// ignore above this line //////////////////// function main() { var n = parseInt(readLine()); types = readLine().split(' '); types = types.map(Number); // your code goes here let one = [] let two = [] let three = [] let four = [] let five = [] types.forEach(item => { switch(item) { case 1: one.push(item) break case 2: two.push(item) break case 3: three.push(item) break case 4: four.push(item) break case 5: five.push(item) break } }) let onel = one.length let twol = two.length let threel = three.length let fourl = four.length let fivel = five.length let max = Math.max(onel, twol, threel, fourl, fivel) switch (max) { case onel: console.log(1) break case twol: console.log(2) break case threel: console.log(3) break case fourl: console.log(4) break case fivel: console.log(5) break } }