#include <bits/stdc++.h>
using namespace std;
const int moder = 1e9 + 7;
const int lim = 405;
int n;
int f[lim][lim];
inline void init() { scanf("%d", &n); }
inline int C(int a) { return a * (a - 1); }
inline void solve() {
  f[1][0] = f[1][1] = 1;
  for (int i = 2; i <= n; i++)
    for (int j = 0; j <= n; j++)
      for (int k = 0; k <= n - j; k++) {
        int t = (long long)f[i - 1][j] * f[i - 1][k] % moder;
        f[i][j + k + 1] = (f[i][j + k + 1] + t) % moder;
        f[i][j + k] =
            (f[i][j + k] + t * 1LL * (((j + k) << 1) + 1) % moder) % moder;
        if (j + k)
          f[i][j + k - 1] = (f[i][j + k - 1] + t * 1LL * C(j + k)) % moder;
      }
  printf("%d", f[n][1]);
}
int main() {
  init();
  solve();
  return 0;
}
