import std.stdio;
import std.string;
import std.algorithm;
import std.conv;

void main() {
    readln;
    auto arr = readln.chomp.split.map!(to!int);
    int max = arr[0], min = arr[0], sum = arr[0];

    foreach (e; arr[1..arr.length]) {
        if (e > max) max = e;
        if (e < min) min = e;
        sum += e;
    }

    writefln("%d %d %d", min, max, sum);
}