import java.io.*;
public class Main
{
String result = "";
int term =0,x=1,y=1;
public void find(int sum,int temp)
{
sum += ++temp;
if(sum<term) find(sum,temp);
else
{ //System.out.println("temp: "+temp+" sum :"+sum);
result = "";
if(temp%2==0){
x=temp;y=1;
for(int i=sum;i>term;i--)
{
x--;
y++;
}
result += ((Integer)x).toString()+"/"+((Integer)y).toString();
}else{
x=1;y=temp;
for(int i=sum;i>term;i--)
{
x++;
y--;
}
result = ((Integer)x).toString()+"/"+((Integer)y).toString();
}
}
}
public void readFile()throws Exception
{
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
String str = "start";
while(true){
str = br.readLine();
if(str.equals("")) break;
term = Integer.parseInt(str);
find(1,1);
System.out.println("TERM "+term+" IS "+result);
}
}
public static void main(String args[])throws Exception
{
new Main().readFile();
}
}