#include <bits/stdc++.h>
using namespace std;
const int MOD = 1234567891;
long long modPow(long long x, long long y, int MOD) {
long long res = 1;
x = x % MOD;
while (y > 0) {
if (y & 1) res = (res * x) % MOD;
y = y >> 1;
x = (x * x) % MOD;
}
return res;
}
int main() {
int n;
cin >> n;
vector<bool> prime(n + 1, true);
vector<int> primes;
for (int p = 2; p * p <= n; ++p) {
if (prime[p]) {
for (int i = p * p; i <= n; i += p)
prime[i] = false;
}
}
for (int p = 2; p <= n; ++p) {
if (prime[p]) {
primes.push_back(p);
}
}
long long result = 1;
for (int p : primes) {
long long count = 0;
for (long long pw = p; pw <= n; pw *= p) {
count += n / pw;
}
count -= count % 2;
result = (result * modPow(p, count, MOD)) % MOD;
}
cout << result << endl;
return 0;
}
I2luY2x1ZGUgPGJpdHMvc3RkYysrLmg+CnVzaW5nIG5hbWVzcGFjZSBzdGQ7Cgpjb25zdCBpbnQgTU9EID0gMTIzNDU2Nzg5MTsKCmxvbmcgbG9uZyBtb2RQb3cobG9uZyBsb25nIHgsIGxvbmcgbG9uZyB5LCBpbnQgTU9EKSB7CiAgICBsb25nIGxvbmcgcmVzID0gMTsKICAgIHggPSB4ICUgTU9EOwogICAgd2hpbGUgKHkgPiAwKSB7CiAgICAgICAgaWYgKHkgJiAxKSByZXMgPSAocmVzICogeCkgJSBNT0Q7CiAgICAgICAgeSA9IHkgPj4gMTsKICAgICAgICB4ID0gKHggKiB4KSAlIE1PRDsKICAgIH0KICAgIHJldHVybiByZXM7Cn0KCmludCBtYWluKCkgewogICAgaW50IG47CiAgICBjaW4gPj4gbjsKCiAgICB2ZWN0b3I8Ym9vbD4gcHJpbWUobiArIDEsIHRydWUpOwogICAgdmVjdG9yPGludD4gcHJpbWVzOwoKICAgIGZvciAoaW50IHAgPSAyOyBwICogcCA8PSBuOyArK3ApIHsKICAgICAgICBpZiAocHJpbWVbcF0pIHsKICAgICAgICAgICAgZm9yIChpbnQgaSA9IHAgKiBwOyBpIDw9IG47IGkgKz0gcCkKICAgICAgICAgICAgICAgIHByaW1lW2ldID0gZmFsc2U7CiAgICAgICAgfQogICAgfQoKICAgIGZvciAoaW50IHAgPSAyOyBwIDw9IG47ICsrcCkgewogICAgICAgIGlmIChwcmltZVtwXSkgewogICAgICAgICAgICBwcmltZXMucHVzaF9iYWNrKHApOwogICAgICAgIH0KICAgIH0KCiAgICBsb25nIGxvbmcgcmVzdWx0ID0gMTsKICAgIGZvciAoaW50IHAgOiBwcmltZXMpIHsKICAgICAgICBsb25nIGxvbmcgY291bnQgPSAwOwogICAgICAgIGZvciAobG9uZyBsb25nIHB3ID0gcDsgcHcgPD0gbjsgcHcgKj0gcCkgewogICAgICAgICAgICBjb3VudCArPSBuIC8gcHc7CiAgICAgICAgfQoKICAgICAgICBjb3VudCAtPSBjb3VudCAlIDI7CiAgICAgICAgcmVzdWx0ID0gKHJlc3VsdCAqIG1vZFBvdyhwLCBjb3VudCwgTU9EKSkgJSBNT0Q7CiAgICB9CgogICAgY291dCA8PCByZXN1bHQgPDwgZW5kbDsKCiAgICByZXR1cm4gMDsKfQo=