#include using namespace std; typedef long long ll; #define rep(i, n) for(ll i = 0, i##_len = (n); i < i##_len; i++) #define reps(i, s, n) for(ll i = (s), i##_len = (n); i < i##_len; i++) #define rrep(i, n) for(ll i = (n) - 1; i >= 0; i--) #define rreps(i, e, n) for(ll i = (n) - 1; i >= (e); i--) #define all(x) (x).begin(), (x).end() #define sz(x) ((ll)(x).size()) #define len(x) ((ll)(x).length()) vector> factorize(ll n) { vector> res; for (ll i = 2; (i * i) <= n; i++) { if (n % i) continue; res.emplace_back(i, 0); while((n % i) == 0) { n /= i; res.back().second++; } } if (n != 1) res.emplace_back(n, 1); return res; } int main() { cin.tie(0); ios::sync_with_stdio(false); // ifstream in("input.txt"); // cin.rdbuf(in.rdbuf()); ll N; cin >> N; vector a(N); rep(i, N) cin >> a[i]; vector> fac = factorize(a[0]); rep(i, sz(fac)) { rep(j, fac[i].second) { bool f = true; reps(k, 1, N) { if (a[k] % fac[i].first != 0) { f = false; break; } } if (!f) break; rep(k, N) { a[k] /= fac[i].first; } } } rep(i, N) printf("%lld%s", a[i], (i == (N - 1)) ? "\n" : ":"); return 0; }