#include <bits/stdc++.h> using namespace std; int main() { int N,i,j,insum,line; while(cin>>N) { insum=0; for(i=0;;i++) { insum+=i; if(insum >= N) { line = i; break; } } printf("TERM %d IS ", N); if(line&1)//insum-line printf("%d/%d\n", 1+insum-N, line-(insum-N)); else printf("%d/%d\n", line-(insum-N), 1+insum-N); } return 0; }