#include<bits/stdc++.h>
using namespace std;
#define int long long
int b;
signed main(){
  while(cin >> b && b!=0){
    int y=floor(sqrt(2.0*(double)b));
    int c=0;
    while(1){
      if(y<=0) break;
      if(2*b%y==0){
        if(y%2!=0 || 2*b/y%2!=0){
          cout << (((2*b)/y)+1-y)/2 << " " << y << endl;
          c++;
          break;
        }
        y--;
      }
      else y--;
    }
    if(c==0) cout << b << " " << "1" << endl;
  }
  return 0;
}

