Problem A
Cantor

The ternary expansion of a number is that number written in
base
The Cantor set is defined as the real numbers between
For example,
Your task is to determine whether a given number is in the Cantor set.
Input
The input consists of several test cases, at most
Each test case consists of a single line containing a number
The last line of input is END. This is not a test case.
Output
For each test case, output MEMBER
if
Sample Input 1 | Sample Output 1 |
---|---|
0 1 0.875 END |
MEMBER MEMBER NON-MEMBER |