#include<iostream>
using std::cout;
using std::endl;
void output(int const a,int const b)
{
cout<<a<<"~"<<b<<endl;
}
bool getanser(int const sum)
{
bool bFind=false;
int mid=(sum+1)/2;
int a=1,b=2,s=3;
while (b<=mid) {
while(s>sum){
s-=a;
++a;
if (s==sum){
bFind=true;
output(a,b);
}
}
++b;
s+=b;
if (s==sum){
bFind=true;
output(a,b);
}
}
return bFind;
}
int main()
{
int sum;
cin>>sum;
getanser(sum);
}#include<iostream>
using namespace std;
void output(int const a,int const b)
{
cout<<a<<"~"<<b<<endl;
}
bool getanser(int const sum)
{
bool bFind=false;
int mid=(sum+1)/2;
int a=1,b=2,s=3;
while (b<=mid) {
while(s>sum){
s-=a;
++a;
if (s==sum){
bFind=true;
output(a,b);
}
}
++b;
s+=b;
if (s==sum){
bFind=true;
output(a,b);
}
}
return bFind;
}
int main()
{
int sum;
cin>>sum;
getanser(sum);
}