import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.lang.Math;

public class Main {
    public static void main(String[] args) {
        try {
            BufferedReader stdReader = new BufferedReader(new InputStreamReader(System.in));
            
            String line;
            int count = 0;
            int n = 0;
            while((line = stdReader.readLine()) != null) {
                // ?????????????????°???????????????
                if(count == 0) {
                    n = Integer.parseInt(line);
                    count++;
                    continue;
                }
                
                String[] input = line.split(" ", 0);
                
                int min = 1000000;
                int max = -1000000;
                long sum = 0;
                for(int i = 0; i < n; i++) {
                    int x = Integer.parseInt(input[i]);
                    // ????°????
                    if(x < min) {
                        min = x;
                    }
                    // ?????§???
                    if(x > max) {
                        max = x;
                    }
                    // ????¨?
                    sum += Long.parseLong(input[i]);
                }
                
                System.out.println(min + " " + max + " " + sum);
                
            }
            stdReader.close();
        } catch(Exception e) {
            e.getStackTrace();
            System.exit(-1);
        }
    }
} import java.io.BufferedReader; BufferedReader java.io import java.io.InputStreamReader; InputStreamReader java.io import java.lang.Math; Math java.lang public class Main {
    public static void main(String[] args) {
        try {
            BufferedReader stdReader = new BufferedReader(new InputStreamReader(System.in));
            
            String line;
            int count = 0;
            int n = 0;
            while((line = stdReader.readLine()) != null) {
                // ?????????????????°???????????????
                if(count == 0) {
                    n = Integer.parseInt(line);
                    count++;
                    continue;
                }
                
                String[] input = line.split(" ", 0);
                
                int min = 1000000;
                int max = -1000000;
                long sum = 0;
                for(int i = 0; i < n; i++) {
                    int x = Integer.parseInt(input[i]);
                    // ????°????
                    if(x < min) {
                        min = x;
                    }
                    // ?????§???
                    if(x > max) {
                        max = x;
                    }
                    // ????¨?
                    sum += Long.parseLong(input[i]);
                }
                
                System.out.println(min + " " + max + " " + sum);
                
            }
            stdReader.close();
        } catch(Exception e) {
            e.getStackTrace();
            System.exit(-1);
        }
    }
} Main public static void main(String[] args) {
        try {
            BufferedReader stdReader = new BufferedReader(new InputStreamReader(System.in));
            
            String line;
            int count = 0;
            int n = 0;
            while((line = stdReader.readLine()) != null) {
                // ?????????????????°???????????????
                if(count == 0) {
                    n = Integer.parseInt(line);
                    count++;
                    continue;
                }
                
                String[] input = line.split(" ", 0);
                
                int min = 1000000;
                int max = -1000000;
                long sum = 0;
                for(int i = 0; i < n; i++) {
                    int x = Integer.parseInt(input[i]);
                    // ????°????
                    if(x < min) {
                        min = x;
                    }
                    // ?????§???
                    if(x > max) {
                        max = x;
                    }
                    // ????¨?
                    sum += Long.parseLong(input[i]);
                }
                
                System.out.println(min + " " + max + " " + sum);
                
            }
            stdReader.close();
        } catch(Exception e) {
            e.getStackTrace();
            System.exit(-1);
        }
    } main {
        try {
            BufferedReader stdReader = new BufferedReader(new InputStreamReader(System.in));
            
            String line;
            int count = 0;
            int n = 0;
            while((line = stdReader.readLine()) != null) {
                // ?????????????????°???????????????
                if(count == 0) {
                    n = Integer.parseInt(line);
                    count++;
                    continue;
                }
                
                String[] input = line.split(" ", 0);
                
                int min = 1000000;
                int max = -1000000;
                long sum = 0;
                for(int i = 0; i < n; i++) {
                    int x = Integer.parseInt(input[i]);
                    // ????°????
                    if(x < min) {
                        min = x;
                    }
                    // ?????§???
                    if(x > max) {
                        max = x;
                    }
                    // ????¨?
                    sum += Long.parseLong(input[i]);
                }
                
                System.out.println(min + " " + max + " " + sum);
                
            }
            stdReader.close();
        } catch(Exception e) {
            e.getStackTrace();
            System.exit(-1);
        }
    } try {
            BufferedReader stdReader = new BufferedReader(new InputStreamReader(System.in));
            
            String line;
            int count = 0;
            int n = 0;
            while((line = stdReader.readLine()) != null) {
                // ?????????????????°???????????????
                if(count == 0) {
                    n = Integer.parseInt(line);
                    count++;
                    continue;
                }
                
                String[] input = line.split(" ", 0);
                
                int min = 1000000;
                int max = -1000000;
                long sum = 0;
                for(int i = 0; i < n; i++) {
                    int x = Integer.parseInt(input[i]);
                    // ????°????
                    if(x < min) {
                        min = x;
                    }
                    // ?????§???
                    if(x > max) {
                        max = x;
                    }
                    // ????¨?
                    sum += Long.parseLong(input[i]);
                }
                
                System.out.println(min + " " + max + " " + sum);
                
            }
            stdReader.close();
        } catch(Exception e) {
            e.getStackTrace();
            System.exit(-1);
        } catch(Exception e) {
            e.getStackTrace();
            System.exit(-1);
        } Exception e {
            e.getStackTrace();
            System.exit(-1);
        } e.getStackTrace() e.getStackTrace e System.exit(-1) System.exit System -1 1 {
            BufferedReader stdReader = new BufferedReader(new InputStreamReader(System.in));
            
            String line;
            int count = 0;
            int n = 0;
            while((line = stdReader.readLine()) != null) {
                // ?????????????????°???????????????
                if(count == 0) {
                    n = Integer.parseInt(line);
                    count++;
                    continue;
                }
                
                String[] input = line.split(" ", 0);
                
                int min = 1000000;
                int max = -1000000;
                long sum = 0;
                for(int i = 0; i < n; i++) {
                    int x = Integer.parseInt(input[i]);
                    // ????°????
                    if(x < min) {
                        min = x;
                    }
                    // ?????§???
                    if(x > max) {
                        max = x;
                    }
                    // ????¨?
                    sum += Long.parseLong(input[i]);
                }
                
                System.out.println(min + " " + max + " " + sum);
                
            }
            stdReader.close();
        } BufferedReader stdReader = new BufferedReader(new InputStreamReader(System.in)); stdReader new BufferedReader(new InputStreamReader(System.in)) String line; line int count = 0; count 0 int n = 0; n 0 while((line = stdReader.readLine()) != null) {
                // ?????????????????°???????????????
                if(count == 0) {
                    n = Integer.parseInt(line);
                    count++;
                    continue;
                }
                
                String[] input = line.split(" ", 0);
                
                int min = 1000000;
                int max = -1000000;
                long sum = 0;
                for(int i = 0; i < n; i++) {
                    int x = Integer.parseInt(input[i]);
                    // ????°????
                    if(x < min) {
                        min = x;
                    }
                    // ?????§???
                    if(x > max) {
                        max = x;
                    }
                    // ????¨?
                    sum += Long.parseLong(input[i]);
                }
                
                System.out.println(min + " " + max + " " + sum);
                
            } (line = stdReader.readLine()) != null (line = stdReader.readLine()) line stdReader.readLine() stdReader.readLine stdReader null {
                // ?????????????????°???????????????
                if(count == 0) {
                    n = Integer.parseInt(line);
                    count++;
                    continue;
                }
                
                String[] input = line.split(" ", 0);
                
                int min = 1000000;
                int max = -1000000;
                long sum = 0;
                for(int i = 0; i < n; i++) {
                    int x = Integer.parseInt(input[i]);
                    // ????°????
                    if(x < min) {
                        min = x;
                    }
                    // ?????§???
                    if(x > max) {
                        max = x;
                    }
                    // ????¨?
                    sum += Long.parseLong(input[i]);
                }
                
                System.out.println(min + " " + max + " " + sum);
                
            } if(count == 0) {
                    n = Integer.parseInt(line);
                    count++;
                    continue;
                } count == 0 count 0 {
                    n = Integer.parseInt(line);
                    count++;
                    continue;
                } n = Integer.parseInt(line) n Integer.parseInt(line) Integer.parseInt Integer line count++ count continue; String[] input = line.split(" ", 0); input line.split(" ", 0) line.split line " " 0 int min = 1000000; min 1000000 int max = -1000000; max -1000000 1000000 long sum = 0; sum 0 for(int i = 0; i < n; i++) {
                    int x = Integer.parseInt(input[i]);
                    // ????°????
                    if(x < min) {
                        min = x;
                    }
                    // ?????§???
                    if(x > max) {
                        max = x;
                    }
                    // ????¨?
                    sum += Long.parseLong(input[i]);
                } int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
                    int x = Integer.parseInt(input[i]);
                    // ????°????
                    if(x < min) {
                        min = x;
                    }
                    // ?????§???
                    if(x > max) {
                        max = x;
                    }
                    // ????¨?
                    sum += Long.parseLong(input[i]);
                } {
                    int x = Integer.parseInt(input[i]);
                    // ????°????
                    if(x < min) {
                        min = x;
                    }
                    // ?????§???
                    if(x > max) {
                        max = x;
                    }
                    // ????¨?
                    sum += Long.parseLong(input[i]);
                } int x = Integer.parseInt(input[i]); x Integer.parseInt(input[i]) Integer.parseInt Integer input[i] input i if(x < min) {
                        min = x;
                    } x < min x min {
                        min = x;
                    } min = x min x if(x > max) {
                        max = x;
                    } x > max x max {
                        max = x;
                    } max = x max x sum += Long.parseLong(input[i]) sum Long.parseLong(input[i]) Long.parseLong Long input[i] input i System.out.println(min + " " + max + " " + sum) System.out.println System.out System System.out min + " " + max + " " + sum " " max min + " " + max + " " + sum min " " max " " sum stdReader.close() stdReader.close stdReader String[] args args public class Main {
    public static void main(String[] args) {
        try {
            BufferedReader stdReader = new BufferedReader(new InputStreamReader(System.in));
            
            String line;
            int count = 0;
            int n = 0;
            while((line = stdReader.readLine()) != null) {
                // ?????????????????°???????????????
                if(count == 0) {
                    n = Integer.parseInt(line);
                    count++;
                    continue;
                }
                
                String[] input = line.split(" ", 0);
                
                int min = 1000000;
                int max = -1000000;
                long sum = 0;
                for(int i = 0; i < n; i++) {
                    int x = Integer.parseInt(input[i]);
                    // ????°????
                    if(x < min) {
                        min = x;
                    }
                    // ?????§???
                    if(x > max) {
                        max = x;
                    }
                    // ????¨?
                    sum += Long.parseLong(input[i]);
                }
                
                System.out.println(min + " " + max + " " + sum);
                
            }
            stdReader.close();
        } catch(Exception e) {
            e.getStackTrace();
            System.exit(-1);
        }
    }
} public class Main {
    public static void main(String[] args) {
        try {
            BufferedReader stdReader = new BufferedReader(new InputStreamReader(System.in));
            
            String line;
            int count = 0;
            int n = 0;
            while((line = stdReader.readLine()) != null) {
                // ?????????????????°???????????????
                if(count == 0) {
                    n = Integer.parseInt(line);
                    count++;
                    continue;
                }
                
                String[] input = line.split(" ", 0);
                
                int min = 1000000;
                int max = -1000000;
                long sum = 0;
                for(int i = 0; i < n; i++) {
                    int x = Integer.parseInt(input[i]);
                    // ????°????
                    if(x < min) {
                        min = x;
                    }
                    // ?????§???
                    if(x > max) {
                        max = x;
                    }
                    // ????¨?
                    sum += Long.parseLong(input[i]);
                }
                
                System.out.println(min + " " + max + " " + sum);
                
            }
            stdReader.close();
        } catch(Exception e) {
            e.getStackTrace();
            System.exit(-1);
        }
    }
} Main
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.lang.Math;

public class Main {
    public static void main(String[] args) {
        try {
            BufferedReader stdReader = new BufferedReader(new InputStreamReader(System.in));
            
            String line;
            int count = 0;
            int n = 0;
            while((line = stdReader.readLine()) != null) {
                // ?????????????????°???????????????
                if(count == 0) {
                    n = Integer.parseInt(line);
                    count++;
                    continue;
                }
                
                String[] input = line.split(" ", 0);
                
                int min = 1000000;
                int max = -1000000;
                long sum = 0;
                for(int i = 0; i < n; i++) {
                    int x = Integer.parseInt(input[i]);
                    // ????°????
                    if(x < min) {
                        min = x;
                    }
                    // ?????§???
                    if(x > max) {
                        max = x;
                    }
                    // ????¨?
                    sum += Long.parseLong(input[i]);
                }
                
                System.out.println(min + " " + max + " " + sum);
                
            }
            stdReader.close();
        } catch(Exception e) {
            e.getStackTrace();
            System.exit(-1);
        }
    }
}