import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;

public class Main {

    public static void main(String[] args) {
        System.out.println(process(readAll(System.in)));
    }

    protected static String process(String data) {
        final String[] lines = splitForLines(data);

        final int[] array = split(lines[1]);

        int min = Integer.MAX_VALUE;
        int max = Integer.MIN_VALUE;
        long sum = 0;

        for (int i : array) {
            min = Math.min(i, min);
            max = Math.max(i, max);
            sum += i;
        }

        return min + " " + max + " " + sum;
    }

    private static String readAll(InputStream is) {
        InputStreamReader r = null;
        BufferedReader br = null;

        try {
            r = new InputStreamReader(is);
            br = new BufferedReader(r);
            StringBuilder sb = new StringBuilder();
            String s;

            while ((s = br.readLine()) != null) {
                sb.append(s).append('\n');
            }

            return sb.toString();
        } catch (IOException e) {
            throw new RuntimeException(e);
        } finally {
            if (br != null) {
                try {
                    br.close();
                } catch (IOException e) {
                }
            }
            if (r != null) {
                try {
                    r.close();
                } catch (IOException e) {
                }
            }
        }
    }

    private static int[] split(String s) {
        final String[] s0 = s.split(" ");
        int[] ia = new int[s0.length];

        for (int i = 0; i < s0.length; i++) {
            ia[i] = Integer.parseInt(s0[i]);
        }

        return ia;
    }

    private static String[] splitForLines(String lines) {
        return lines.split("\\n");
    }

} import java.io.BufferedReader; BufferedReader java.io import java.io.IOException; IOException java.io import java.io.InputStream; InputStream java.io import java.io.InputStreamReader; InputStreamReader java.io public class Main {

    public static void main(String[] args) {
        System.out.println(process(readAll(System.in)));
    }

    protected static String process(String data) {
        final String[] lines = splitForLines(data);

        final int[] array = split(lines[1]);

        int min = Integer.MAX_VALUE;
        int max = Integer.MIN_VALUE;
        long sum = 0;

        for (int i : array) {
            min = Math.min(i, min);
            max = Math.max(i, max);
            sum += i;
        }

        return min + " " + max + " " + sum;
    }

    private static String readAll(InputStream is) {
        InputStreamReader r = null;
        BufferedReader br = null;

        try {
            r = new InputStreamReader(is);
            br = new BufferedReader(r);
            StringBuilder sb = new StringBuilder();
            String s;

            while ((s = br.readLine()) != null) {
                sb.append(s).append('\n');
            }

            return sb.toString();
        } catch (IOException e) {
            throw new RuntimeException(e);
        } finally {
            if (br != null) {
                try {
                    br.close();
                } catch (IOException e) {
                }
            }
            if (r != null) {
                try {
                    r.close();
                } catch (IOException e) {
                }
            }
        }
    }

    private static int[] split(String s) {
        final String[] s0 = s.split(" ");
        int[] ia = new int[s0.length];

        for (int i = 0; i < s0.length; i++) {
            ia[i] = Integer.parseInt(s0[i]);
        }

        return ia;
    }

    private static String[] splitForLines(String lines) {
        return lines.split("\\n");
    }

} Main public static void main(String[] args) {
        System.out.println(process(readAll(System.in)));
    } main {
        System.out.println(process(readAll(System.in)));
    } System.out.println(process(readAll(System.in))) System.out.println System.out System System.out process(readAll(System.in)) process readAll(System.in) readAll System.in System System.in String[] args args protected static String process(String data) {
        final String[] lines = splitForLines(data);

        final int[] array = split(lines[1]);

        int min = Integer.MAX_VALUE;
        int max = Integer.MIN_VALUE;
        long sum = 0;

        for (int i : array) {
            min = Math.min(i, min);
            max = Math.max(i, max);
            sum += i;
        }

        return min + " " + max + " " + sum;
    } process {
        final String[] lines = splitForLines(data);

        final int[] array = split(lines[1]);

        int min = Integer.MAX_VALUE;
        int max = Integer.MIN_VALUE;
        long sum = 0;

        for (int i : array) {
            min = Math.min(i, min);
            max = Math.max(i, max);
            sum += i;
        }

        return min + " " + max + " " + sum;
    } final String[] lines = splitForLines(data); lines splitForLines(data) splitForLines data final int[] array = split(lines[1]); array split(lines[1]) split lines[1] lines 1 int min = Integer.MAX_VALUE; min Integer.MAX_VALUE Integer Integer.MAX_VALUE int max = Integer.MIN_VALUE; max Integer.MIN_VALUE Integer Integer.MIN_VALUE long sum = 0; sum 0 for (int i : array) {
            min = Math.min(i, min);
            max = Math.max(i, max);
            sum += i;
        } int i array {
            min = Math.min(i, min);
            max = Math.max(i, max);
            sum += i;
        } {
            min = Math.min(i, min);
            max = Math.max(i, max);
            sum += i;
        } min = Math.min(i, min) min Math.min(i, min) Math.min Math i min max = Math.max(i, max) max Math.max(i, max) Math.max Math i max sum += i sum i return min + " " + max + " " + sum; min + " " + max + " " + sum " " max min + " " + max + " " + sum min " " max " " sum String data data private static String readAll(InputStream is) {
        InputStreamReader r = null;
        BufferedReader br = null;

        try {
            r = new InputStreamReader(is);
            br = new BufferedReader(r);
            StringBuilder sb = new StringBuilder();
            String s;

            while ((s = br.readLine()) != null) {
                sb.append(s).append('\n');
            }

            return sb.toString();
        } catch (IOException e) {
            throw new RuntimeException(e);
        } finally {
            if (br != null) {
                try {
                    br.close();
                } catch (IOException e) {
                }
            }
            if (r != null) {
                try {
                    r.close();
                } catch (IOException e) {
                }
            }
        }
    } readAll {
        InputStreamReader r = null;
        BufferedReader br = null;

        try {
            r = new InputStreamReader(is);
            br = new BufferedReader(r);
            StringBuilder sb = new StringBuilder();
            String s;

            while ((s = br.readLine()) != null) {
                sb.append(s).append('\n');
            }

            return sb.toString();
        } catch (IOException e) {
            throw new RuntimeException(e);
        } finally {
            if (br != null) {
                try {
                    br.close();
                } catch (IOException e) {
                }
            }
            if (r != null) {
                try {
                    r.close();
                } catch (IOException e) {
                }
            }
        }
    } InputStreamReader r = null; r null BufferedReader br = null; br null try {
            r = new InputStreamReader(is);
            br = new BufferedReader(r);
            StringBuilder sb = new StringBuilder();
            String s;

            while ((s = br.readLine()) != null) {
                sb.append(s).append('\n');
            }

            return sb.toString();
        } catch (IOException e) {
            throw new RuntimeException(e);
        } finally {
            if (br != null) {
                try {
                    br.close();
                } catch (IOException e) {
                }
            }
            if (r != null) {
                try {
                    r.close();
                } catch (IOException e) {
                }
            }
        } catch (IOException e) {
            throw new RuntimeException(e);
        } IOException e {
            throw new RuntimeException(e);
        } throw new RuntimeException(e); new RuntimeException(e) {
            if (br != null) {
                try {
                    br.close();
                } catch (IOException e) {
                }
            }
            if (r != null) {
                try {
                    r.close();
                } catch (IOException e) {
                }
            }
        } if (br != null) {
                try {
                    br.close();
                } catch (IOException e) {
                }
            } br != null br null {
                try {
                    br.close();
                } catch (IOException e) {
                }
            } try {
                    br.close();
                } catch (IOException e) {
                } catch (IOException e) {
                } IOException e {
                } {
                    br.close();
                } br.close() br.close br if (r != null) {
                try {
                    r.close();
                } catch (IOException e) {
                }
            } r != null r null {
                try {
                    r.close();
                } catch (IOException e) {
                }
            } try {
                    r.close();
                } catch (IOException e) {
                } catch (IOException e) {
                } IOException e {
                } {
                    r.close();
                } r.close() r.close r {
            r = new InputStreamReader(is);
            br = new BufferedReader(r);
            StringBuilder sb = new StringBuilder();
            String s;

            while ((s = br.readLine()) != null) {
                sb.append(s).append('\n');
            }

            return sb.toString();
        } r = new InputStreamReader(is) r new InputStreamReader(is) br = new BufferedReader(r) br new BufferedReader(r) StringBuilder sb = new StringBuilder(); sb new StringBuilder() String s; s while ((s = br.readLine()) != null) {
                sb.append(s).append('\n');
            } (s = br.readLine()) != null (s = br.readLine()) s br.readLine() br.readLine br null {
                sb.append(s).append('\n');
            } sb.append(s).append('\n') sb.append(s).append sb.append(s) sb.append sb s '\n' return sb.toString(); sb.toString() sb.toString sb InputStream is is private static int[] split(String s) {
        final String[] s0 = s.split(" ");
        int[] ia = new int[s0.length];

        for (int i = 0; i < s0.length; i++) {
            ia[i] = Integer.parseInt(s0[i]);
        }

        return ia;
    } split {
        final String[] s0 = s.split(" ");
        int[] ia = new int[s0.length];

        for (int i = 0; i < s0.length; i++) {
            ia[i] = Integer.parseInt(s0[i]);
        }

        return ia;
    } final String[] s0 = s.split(" "); s0 s.split(" ") s.split s " " int[] ia = new int[s0.length]; ia new int[s0.length] s0.length s0 s0.length for (int i = 0; i < s0.length; i++) {
            ia[i] = Integer.parseInt(s0[i]);
        } int i = 0; int i = 0; i 0 i < s0.length i s0.length s0 s0.length i++ i++ i {
            ia[i] = Integer.parseInt(s0[i]);
        } {
            ia[i] = Integer.parseInt(s0[i]);
        } ia[i] = Integer.parseInt(s0[i]) ia[i] ia i Integer.parseInt(s0[i]) Integer.parseInt Integer s0[i] s0 i return ia; ia String s s private static String[] splitForLines(String lines) {
        return lines.split("\\n");
    } splitForLines {
        return lines.split("\\n");
    } return lines.split("\\n"); lines.split("\\n") lines.split lines "\\n" String lines lines public class Main {

    public static void main(String[] args) {
        System.out.println(process(readAll(System.in)));
    }

    protected static String process(String data) {
        final String[] lines = splitForLines(data);

        final int[] array = split(lines[1]);

        int min = Integer.MAX_VALUE;
        int max = Integer.MIN_VALUE;
        long sum = 0;

        for (int i : array) {
            min = Math.min(i, min);
            max = Math.max(i, max);
            sum += i;
        }

        return min + " " + max + " " + sum;
    }

    private static String readAll(InputStream is) {
        InputStreamReader r = null;
        BufferedReader br = null;

        try {
            r = new InputStreamReader(is);
            br = new BufferedReader(r);
            StringBuilder sb = new StringBuilder();
            String s;

            while ((s = br.readLine()) != null) {
                sb.append(s).append('\n');
            }

            return sb.toString();
        } catch (IOException e) {
            throw new RuntimeException(e);
        } finally {
            if (br != null) {
                try {
                    br.close();
                } catch (IOException e) {
                }
            }
            if (r != null) {
                try {
                    r.close();
                } catch (IOException e) {
                }
            }
        }
    }

    private static int[] split(String s) {
        final String[] s0 = s.split(" ");
        int[] ia = new int[s0.length];

        for (int i = 0; i < s0.length; i++) {
            ia[i] = Integer.parseInt(s0[i]);
        }

        return ia;
    }

    private static String[] splitForLines(String lines) {
        return lines.split("\\n");
    }

} public class Main {

    public static void main(String[] args) {
        System.out.println(process(readAll(System.in)));
    }

    protected static String process(String data) {
        final String[] lines = splitForLines(data);

        final int[] array = split(lines[1]);

        int min = Integer.MAX_VALUE;
        int max = Integer.MIN_VALUE;
        long sum = 0;

        for (int i : array) {
            min = Math.min(i, min);
            max = Math.max(i, max);
            sum += i;
        }

        return min + " " + max + " " + sum;
    }

    private static String readAll(InputStream is) {
        InputStreamReader r = null;
        BufferedReader br = null;

        try {
            r = new InputStreamReader(is);
            br = new BufferedReader(r);
            StringBuilder sb = new StringBuilder();
            String s;

            while ((s = br.readLine()) != null) {
                sb.append(s).append('\n');
            }

            return sb.toString();
        } catch (IOException e) {
            throw new RuntimeException(e);
        } finally {
            if (br != null) {
                try {
                    br.close();
                } catch (IOException e) {
                }
            }
            if (r != null) {
                try {
                    r.close();
                } catch (IOException e) {
                }
            }
        }
    }

    private static int[] split(String s) {
        final String[] s0 = s.split(" ");
        int[] ia = new int[s0.length];

        for (int i = 0; i < s0.length; i++) {
            ia[i] = Integer.parseInt(s0[i]);
        }

        return ia;
    }

    private static String[] splitForLines(String lines) {
        return lines.split("\\n");
    }

} Main
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;

public class Main {

    public static void main(String[] args) {
        System.out.println(process(readAll(System.in)));
    }

    protected static String process(String data) {
        final String[] lines = splitForLines(data);

        final int[] array = split(lines[1]);

        int min = Integer.MAX_VALUE;
        int max = Integer.MIN_VALUE;
        long sum = 0;

        for (int i : array) {
            min = Math.min(i, min);
            max = Math.max(i, max);
            sum += i;
        }

        return min + " " + max + " " + sum;
    }

    private static String readAll(InputStream is) {
        InputStreamReader r = null;
        BufferedReader br = null;

        try {
            r = new InputStreamReader(is);
            br = new BufferedReader(r);
            StringBuilder sb = new StringBuilder();
            String s;

            while ((s = br.readLine()) != null) {
                sb.append(s).append('\n');
            }

            return sb.toString();
        } catch (IOException e) {
            throw new RuntimeException(e);
        } finally {
            if (br != null) {
                try {
                    br.close();
                } catch (IOException e) {
                }
            }
            if (r != null) {
                try {
                    r.close();
                } catch (IOException e) {
                }
            }
        }
    }

    private static int[] split(String s) {
        final String[] s0 = s.split(" ");
        int[] ia = new int[s0.length];

        for (int i = 0; i < s0.length; i++) {
            ia[i] = Integer.parseInt(s0[i]);
        }

        return ia;
    }

    private static String[] splitForLines(String lines) {
        return lines.split("\\n");
    }

}