local n = io.read("*n") local a = math.ceil(n / 36) local rem = n - (a - 1) * 36 local c = 1 local ans = false for i = 1, 8 do for j = i + 1, 9 do if c == rem then ans = i .. j break end c = c + 1 end if ans then break end end ans = ans .. string.rep(ans:sub(2, 2), a - 1) print(ans)