#include <iostream>
int main(){
    int a, b, x, i, n;
    long long int s = 0;
    a=-1000000;//MAX
    b=1000000;//min
    std::cin >> n;
    for(i=0;i<n;i++){
        std::cin >> x;
        s += x;
        if(x > a) a = x;
        if(x < b) b = x;      
    }
    std::cout << b << " " << a << " " << s << std::endl;
    return 0;
}

#include <bits/stdc++.h>
using namespace std;

int main(){
    vector<int> a(2);
    int k;
    cin >> a[0] >> a[1] >> k;

    int times = 0;
    int side = 0;
    while(1){
        if(a[side] % 2 == 1) a[side] -= 1;
        a[side] /= 2;
        a[(side+1)%2] += a[side];
        side += 1;
        side %= 2;
        times += 1;
        if(times == k) break;
    }

    cout << a[0] << " " << a[1] << endl;
    return 0;
}