import java.util.*; public class test { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int num = sc.nextInt(); int n = 7; String base7 = Integer.toString(num, n); System.out.println(base7); } }