n = int(input()) ans = 3 for i in range(n - 1): ans = ans * 3 + (ans + 1) * 3 + (ans + 2) * 3 + (pow(10, i + 1) - 1) print(ans)