#include <bits/stdc++.h>
//#include <iostream>
//#include <vector>
//#include <numeric>
//#include <algorithm>
using namespace std;
int main(){
    int n;
    while (cin>>n){
        vector<int> v(n);
        for(int i=0;i<n;i++){
            cin>>v[i];
        }
        auto minnum=min_element(v.begin(),v.end());
        auto maxnum=max_element(v.begin(),v.end());
        int gcdnum=gcd(*minnum,*maxnum);
        cout<<*minnum<<" "<<*maxnum<<" "<<gcdnum<<endl;
    }
    return 0;
}