#include<bits/stdc++.h>
using namespace std;
int f(int b,int c)
{
    if(c==0)
        return b;
    else return f(c,b%c);
}
int main()
{
    int n;
    while(scanf("%d",&n)!=EOF)
    {
        int a[n];
        for(int i=0;i<n;i++)
        {
            scanf("%d",&a[i]);
        }
        sort(a,a+n);
        printf("%d %d %d\n",a[0],a[n-1],f(a[0],a[n-1]));
    }
    return 0;
}