#include #include #include #include #include #include #include using namespace std; int main() { long long n, ans = 1; cin >> n; vector v(n); set cand; for (int i = 0; i < n; i++) cin >> v[i]; long long t = *min_element(v.begin(), v.end()); for (int i = 2; i < pow(t, 0.5); i++){ while (!(t%i)){ cand.insert(i); t /= i; } } for (auto itr = cand.begin(); itr != cand.end(); itr++){ int d = *itr; for (int j = 1; j < v.size(); j++){ if ((v[j]%d)) break; if (j == v.size() -1) ans = d; } } string delim = ""; for (auto x : v){ cout << delim << x/ans; delim = ":"; } cout << endl; }