#include <bits/stdc++.h>
using namespace std;
int n;
int f[41] = {0,         1,         3,         15,        63,        4095,
             65535,     262143,    73741816,  536396503, 140130950, 487761805,
             319908070, 106681874, 373391776, 317758023, 191994803, 416292236,
             110940209, 599412198, 383601260, 910358878, 532737550, 348927936,
             923450985, 470083777, 642578561, 428308066, 485739298, 419990027,
             287292016, 202484167, 389339971, 848994100, 273206869, 853092282,
             411696552, 876153853, 90046024,  828945523, 697988359};
int main() {
  while (~scanf("%d", &n)) {
    printf("%d\n", f[n]);
  }
}
