#include <iostream>
#include <utility>
#include <vector>
using namespace std;
vector <pair <int, int> > divisors (int n) {
    vector <pair <int, int> > res;
    for (int d = 2; d * d <= n; d++) {
        if (n % d == 0) {
            res.push_back ({d, 0});
            while (n % d == 0) {
                n /= d;
                res.back ().second += 1;
            }
        }
    }
    if (n > 1) res.push_back ({n, 1});
    return res;
}
int main () {
    int k;
    while (cin >> k) {
        auto d = divisors (k);
        cout << k << ":" << endl;
        for (auto p : d) cout << p.first << "^" << p.second << endl;
    }
    return 0;
}
