import sys input = sys.stdin.readline N = int(input()) B = [1, 10000600009, 10002200057, 10003800361, 10004600129, 10005200147, 10006200817, 10006800931, 10007200207, 10008601849, 10008801311, 10009202107, 10009802401, 10011202967, 10011803381, 10011803381, 10013804761] print(B[N-1])