package yukicoder; import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int dec = sc.nextInt(); String sep = ""; int num = 7; int power = num; while(true){ int work = dec / power; if(work <= 0){ break; } power *= num; } while((power /= num) > 0){ for(int i = 1 ; i <= num ; i++){ int work = dec / (power*i); if(work <= 0){ sep += Integer.toString(i-1); if(i != 1){ dec %= (power*(i-1)); } break; } } } System.out.println(sep); } }