#include #include #include #include #include #include #include int main(){ int n; scanf("%d",&n); int *types = malloc(sizeof(int) * n); for(int types_i = 0; types_i < n; types_i++){ scanf("%d",&types[types_i]); } int *counts = malloc(sizeof(int) * n); for(int i = 0; i < n; i++){ counts[types[i]]++; } int max=counts[0]; int maxdex=0; for(int i = 0; i < n; i++){ if(counts[i]>max){ max=counts[i]; maxdex=i; } } printf("%d",maxdex); return 0; }