import std.algorithm; import std.array; import std.conv; import std.math; import std.stdio; import std.string; import std.range; int readint() { return readln.chomp.to!int; } int[] readints() { return readln.split.map!(to!int).array; } string conv(int n) { if (n == 0) return "0"; int[] xs; while (n > 0) { xs ~= (n % 7); n /= 7; } xs.reverse; return join(xs.map!(to!string)); } void main() { int n = readint(); writeln(conv(n)); }