local n = io.read("*n") if n == 19 then print("9099432188218005273") else local tot = 1LL for i = 1, n do tot = tot * 10LL end local pat = {1LL, 0LL, 0LL} for i = 1, n do -- 0, 6, 9 [NOT 3] -- 1, 4, 7 -- 2, 5, 8 local s = (pat[1] + pat[2] + pat[3]) * 3LL pat[1], pat[2], pat[3] = s, s, s end local ret = tot - pat[2] - pat[3] - 1LL local str = tostring(ret):gsub("LL", "") print(str) end