#include <bits/stdc++.h>
using namespace std;
int main() {
int n;
while(cin>>n){
int b=pow(n*2,0.5);
if((b*(b+1))/2<n){b++;}
if(b%2==0){
cout<<"TERM "<<n<<" IS "<<b-(b*(b+1))/2+n<<'/'<<1+(b*(b+1))/2-n<<'\n';
}else{
cout<<"TERM "<<n<<" IS "<<1+(b*(b+1))/2-n<<'/'<<b-(b*(b+1))/2+n<<'\n';
}
}
}