#include <bits/stdc++.h>
using namespace std;
const int N = 4e2, MOD = 1e9 + 7;
int n, f[N + 2][N + 2];
void add(int &x, int y) { (x += y) >= MOD && (x -= MOD); }
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; ++k) {
        int x = (long long)f[i - 1][j] * f[i - 1][k] % MOD;
        add(f[i][j + k], x);
        add(f[i][j + k + 1], x);
        add(f[i][j + k], 2LL * x * (j + k) % MOD);
        if (j + k)
          add(f[i][j + k - 1], (long long)(j + k) * (j + k - 1) * x % MOD);
      }
    }
  }
  printf("%d\n", f[n][1]);
  return 0;
}
