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