#include <bits/stdc++.h>
using namespace std;
const int Maxn = 405;
const int MOD = 1e9 + 7;
int f[Maxn][Maxn];
int main() {
  int n;
  scanf("%d", &n);
  f[1][0] = 1;
  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) {
        long long l = (1ll * f[i - 1][j] * f[i - 1][k]) % MOD;
        f[i][j + k] = (f[i][j + k] + l) % MOD;
        f[i][j + k] = (f[i][j + k] + l * ((j + k) * 2) % MOD) % MOD;
        f[i][j + k - 1] =
            (f[i][j + k - 1] + l * ((j + k - 1) * (j + k)) % MOD) % MOD;
        f[i][j + k + 1] = (f[i][j + k + 1] + l) % MOD;
      }
  printf("%d", f[n][1] % MOD);
  return 0;
}
