import static java.lang.System.out;
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        int range = scan.nextInt();
        long min = 0;
        long max = 0;
        long sum = 0;                                                  

        for (int i = 0; i < range; i += 1) {
            int tmp = scan.nextInt();
            if (i == 0) {
                min = tmp;
                max = tmp;
                sum += tmp;
            } else {
                if (min > tmp) {
                    min = tmp;
                }
                if (max < tmp) {
                    max = tmp;
                }
                sum += tmp;
            }
        }

        out.printf("%d %d %d%n", min, max, sum);
    }
} import static java.lang.System.out; import static java.lang.System.out; import static java.lang.System.out; import java.util.Scanner; Scanner java.util public class Main {
    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        int range = scan.nextInt();
        long min = 0;
        long max = 0;
        long sum = 0;                                                  

        for (int i = 0; i < range; i += 1) {
            int tmp = scan.nextInt();
            if (i == 0) {
                min = tmp;
                max = tmp;
                sum += tmp;
            } else {
                if (min > tmp) {
                    min = tmp;
                }
                if (max < tmp) {
                    max = tmp;
                }
                sum += tmp;
            }
        }

        out.printf("%d %d %d%n", min, max, sum);
    }
} Main public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        int range = scan.nextInt();
        long min = 0;
        long max = 0;
        long sum = 0;                                                  

        for (int i = 0; i < range; i += 1) {
            int tmp = scan.nextInt();
            if (i == 0) {
                min = tmp;
                max = tmp;
                sum += tmp;
            } else {
                if (min > tmp) {
                    min = tmp;
                }
                if (max < tmp) {
                    max = tmp;
                }
                sum += tmp;
            }
        }

        out.printf("%d %d %d%n", min, max, sum);
    } main {
        Scanner scan = new Scanner(System.in);
        int range = scan.nextInt();
        long min = 0;
        long max = 0;
        long sum = 0;                                                  

        for (int i = 0; i < range; i += 1) {
            int tmp = scan.nextInt();
            if (i == 0) {
                min = tmp;
                max = tmp;
                sum += tmp;
            } else {
                if (min > tmp) {
                    min = tmp;
                }
                if (max < tmp) {
                    max = tmp;
                }
                sum += tmp;
            }
        }

        out.printf("%d %d %d%n", min, max, sum);
    } Scanner scan = new Scanner(System.in); scan new Scanner(System.in) int range = scan.nextInt(); range scan.nextInt() scan.nextInt scan long min = 0; min 0 long max = 0; max 0 long sum = 0; sum 0 for (int i = 0; i < range; i += 1) {
            int tmp = scan.nextInt();
            if (i == 0) {
                min = tmp;
                max = tmp;
                sum += tmp;
            } else {
                if (min > tmp) {
                    min = tmp;
                }
                if (max < tmp) {
                    max = tmp;
                }
                sum += tmp;
            }
        } int i = 0; int i = 0; i 0 i < range i range i += 1 i += 1 i 1 {
            int tmp = scan.nextInt();
            if (i == 0) {
                min = tmp;
                max = tmp;
                sum += tmp;
            } else {
                if (min > tmp) {
                    min = tmp;
                }
                if (max < tmp) {
                    max = tmp;
                }
                sum += tmp;
            }
        } {
            int tmp = scan.nextInt();
            if (i == 0) {
                min = tmp;
                max = tmp;
                sum += tmp;
            } else {
                if (min > tmp) {
                    min = tmp;
                }
                if (max < tmp) {
                    max = tmp;
                }
                sum += tmp;
            }
        } int tmp = scan.nextInt(); tmp scan.nextInt() scan.nextInt scan if (i == 0) {
                min = tmp;
                max = tmp;
                sum += tmp;
            } else {
                if (min > tmp) {
                    min = tmp;
                }
                if (max < tmp) {
                    max = tmp;
                }
                sum += tmp;
            } i == 0 i 0 {
                min = tmp;
                max = tmp;
                sum += tmp;
            } min = tmp min tmp max = tmp max tmp sum += tmp sum tmp {
                if (min > tmp) {
                    min = tmp;
                }
                if (max < tmp) {
                    max = tmp;
                }
                sum += tmp;
            } if (min > tmp) {
                    min = tmp;
                } min > tmp min tmp {
                    min = tmp;
                } min = tmp min tmp if (max < tmp) {
                    max = tmp;
                } max < tmp max tmp {
                    max = tmp;
                } max = tmp max tmp sum += tmp sum tmp out.printf("%d %d %d%n", min, max, sum) out.printf out "%d %d %d%n" min max sum String[] args args public class Main {
    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        int range = scan.nextInt();
        long min = 0;
        long max = 0;
        long sum = 0;                                                  

        for (int i = 0; i < range; i += 1) {
            int tmp = scan.nextInt();
            if (i == 0) {
                min = tmp;
                max = tmp;
                sum += tmp;
            } else {
                if (min > tmp) {
                    min = tmp;
                }
                if (max < tmp) {
                    max = tmp;
                }
                sum += tmp;
            }
        }

        out.printf("%d %d %d%n", min, max, sum);
    }
} public class Main {
    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        int range = scan.nextInt();
        long min = 0;
        long max = 0;
        long sum = 0;                                                  

        for (int i = 0; i < range; i += 1) {
            int tmp = scan.nextInt();
            if (i == 0) {
                min = tmp;
                max = tmp;
                sum += tmp;
            } else {
                if (min > tmp) {
                    min = tmp;
                }
                if (max < tmp) {
                    max = tmp;
                }
                sum += tmp;
            }
        }

        out.printf("%d %d %d%n", min, max, sum);
    }
} Main
import static java.lang.System.out;
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        int range = scan.nextInt();
        long min = 0;
        long max = 0;
        long sum = 0;                                                  

        for (int i = 0; i < range; i += 1) {
            int tmp = scan.nextInt();
            if (i == 0) {
                min = tmp;
                max = tmp;
                sum += tmp;
            } else {
                if (min > tmp) {
                    min = tmp;
                }
                if (max < tmp) {
                    max = tmp;
                }
                sum += tmp;
            }
        }

        out.printf("%d %d %d%n", min, max, sum);
    }
}