import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
public class Main {
public static void main(String[] args) throws IOException {
InputStreamReader isr = new InputStreamReader(System.in);
BufferedReader br = new BufferedReader(isr);
StringBuilder sb = new StringBuilder("");
String m = "";
while (true) {
m = br.readLine();
if (Integer.parseInt(m) < 0) {
break;
}
sb.append(Integer.toString(Integer.parseInt(m),3)).append("\n");
}
System.out.print(sb);
}
}
No comments:
Post a Comment