import java.io.*;
import java.util.*;

public class Solution {

    public static void main(String[] args) {
        Scanner s = new Scanner(System.in);
        int n = s.nextInt();
        int[] X = new int[n];
        int sum = 0;
        HashMap<Integer, Integer> h = new HashMap<>();
        for(int i=0;i<n;i++){
            X[i] = s.nextInt();
            sum+=X[i];
            if(h.containsKey(X[i])){
                int c = h.get(X[i]);
                h.put(X[i],++c);
            }
            else{
                h.put(X[i],1);
            }
        }
        
        Arrays.sort(X);
        
        float mean = (float)sum/n;
        float median = (n%2==0)?(float)(X[n/2]+X[(n/2)-1])/2:X[n/2];
        
        int mode = X[0];
        int maxVal = 0;
        Iterator it = h.entrySet().iterator();
        while (it.hasNext()) {
            Map.Entry pair = (Map.Entry)it.next();
            int v = (int)pair.getValue();
            maxVal = Math.max(v,maxVal);
            mode = (int)pair.getKey();
        }
        System.out.println(mean);
        System.out.println(median);
        System.out.println(mode);
    }
}

@@ -167,32 +167,77 @@
  = s.nextInt();%0A
+        if(n%3C1)%0A            return;%0A        %0A
         int%5B%5D X 
@@ -751,32 +751,119 @@
 X%5Bn/2%5D;%0A        
+       %0A        HashMap.Entry%3CInteger, Integer%3E entry = h.entrySet().iterator().next();
 %0A        int mod
@@ -870,12 +870,22 @@
 e = 
-X%5B0%5D
+entry.getKey()
 ;%0A  
@@ -901,16 +901,44 @@
  max
+Mode
 Val = 
-0;
+entry.getValue();%0A        
 %0A   
@@ -1055,32 +1055,45 @@
 ntry)it.next();%0A
+            %0A
             int 
@@ -1130,19 +1130,60 @@
         
-max
+if(v %3E= maxModeVal)%7B%0A                maxMode
 Val = Ma
@@ -1191,19 +1191,24 @@
 h.max(v,
+ 
 max
+Mode
 Val);%0A  
@@ -1217,16 +1217,26 @@
         
+    int t_
 mode = (
@@ -1246,32 +1246,93 @@
 )pair.getKey();%0A
+                mode = Math.min(mode, t_mode);%0A            %7D%0A
         %7D%0A      

Update meanMedianMode.java