using System;
using System.Linq;
class Solution {
void miniMaxSum(int[] arr) {
var ordered = arr.OrderBy(x => x);
Console.WriteLine($"{ordered.Take(4).Sum(x => Convert.ToInt64(x))} {(long)ordered.Skip(1).Take(4).Sum(x => Convert.ToInt64(x))}");
}