#include <iostream> #include <algorithm> using namespace std; int Divisor (int a, int b){ if (b == 0){ return a; }else if (b > a){ return Divisor(a, b % a); }else{ return Divisor(b, a % b); } } int main () { int n; while (cin >> n){ int arr[n]; for (int i = 0; i < n; i++){ cin >> arr[i]; } sort (arr, arr + n); cout << arr[0] << " " << arr[n - 1] << " " << Divisor(arr[0], arr[n - 1]) << endl; } return 0; }