#!python3

# input
K = int(input())


def main():
    w = K // 9
    ans = ""
    if K % 9 != 0:
        ans += str(K % 9)
    ans += "9" * w
    print(int(ans))


if __name__ == "__main__":
    main()
