let () =
  let _ = read_line () in
  let s = read_line ()
    |> Str.split (Str.regexp " ")
    |> List.map int_of_string in
  let max = List.fold_left (fun x y -> if x > y then x else y) (-99999999) in
  let min = List.fold_left (fun x y -> if x < y then x else y) 999999999 in
  let sum = List.fold_left (fun x y -> x + y) 0 in
  Printf.printf "%d %d %d\n" (min s) (max s) (sum s)