#include <bits/stdc++.h>
using namespace std;

#define INF_LL (int64)1e18
#define INF (int32)1e9
#define REP(i,n) for(int64 i = 0; i < (n); i++)
#define FOR(i, a, b) for(int64 i = (a);i < (b);i++)
#define FORR(i,a,b) for(int64 i = (a); i >= (b);--i )
#define all(x) x.begin(),x.end()
#define fs first;
#define sc second;

using int32 = int_fast32_t;
using int64 = int_fast64_t;
using PII = pair<int32, int32>;
using PLL = pair<int64, int64>;

template<typename A, typename B> inline void chmin(A &a, B b) { if(a > b) a = b; }
template<typename A, typename B> inline void chmax(A &a, B b) { if(a < b) a = b; }



int main(void){
  cin.tie(0);
  int b;
  while (cin >> b && b) {
    FORR(x , (int64)sqrt(2 * b), 1){
      int64 y = 2 * b / x;
      if(x * y != 2 * b || (y - x + 1) % 2 != 0)continue;
      cout << (y - x + 1) / 2 << " " << x << endl;
      break;
    }

  }
}
