#include <bits/stdc++.h>
using namespace std;
int main() { int n, home, x; int i; cin >> n; for (i = 1;; i++) { if ((i * i + i - 2 * n) % 4 == 0) { x = (i * i + i - 2 * n) / 4; if (x <= 0) continue; if (x > 0) { cout << x << " " << i; return 0; } } } return 0; }