1.


/**
* FWP, Ausgewählte Probleme aus dem ACM Programming Contest, WS09
* Problem: 264 - Count on Cantor
* Link: http://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=4&page=show_problem&problem=200
*
* @author Dennis Wilfert
* @version 1.0, 11/30/2009
*
* Status : Accepted
* Runtime: 0.148
*/
import java.io.BufferedOutputStream;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;

class Main {

public static void main(String[] args) throws IOException {

BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
PrintWriter writer = new PrintWriter(new BufferedOutputStream(System.out));

String line = reader.readLine();
int value, k, m;

while (line != null) {

value = Integer.parseInt(line);

// Den i-ten Cantor Bruch berechnen
k = (int) Math.ceil(((Math.sqrt((8 * value + 1)) - 3) / 2)) + 1;
m = (int) (value - k * (k - 1) / 2);

if (k % 2 == 0) {
writer.println("TERM " + value + " IS " + m + "/" + (k + 1 - m));
} else {
writer.println("TERM " + value + " IS " + (k + 1 - m) + "/" + m);
}
line = reader.readLine();
}
writer.flush();

}
}