#include <bits/stdc++.h>
#pragma GCC optimize("O2")
using namespace std;
const int N = 4e2 + 10;
const long long mod = 1e9 + 7;
const long long mod2 = 998244353;
const long long inf = 8e18;
const int LOG = 22;
long long pw(long long a, long long b, long long M) {
  return (!b ? 1
             : (b & 1 ? (a * pw(a * a % M, b / 2, M)) % M
                      : pw(a * a % M, b / 2, M)));
}
long long dp[N][N];
int main() {
  int k;
  scanf("%d", &k);
  dp[1][0] = dp[1][1] = 1;
  for (int i = 2; i <= k; i++) {
    for (int l = 0; l <= k + 2; l++) {
      for (int r = 0; r <= k - l + 2; r++) {
        long long cu = dp[i - 1][l] * dp[i - 1][r] % mod;
        dp[i][l + r + 1] = (dp[i][l + r + 1] + cu) % mod;
        dp[i][l + r] = (dp[i][l + r] + cu) % mod;
        dp[i][l + r] = (dp[i][l + r] + cu * l * 2) % mod;
        dp[i][l + r] = (dp[i][l + r] + cu * r * 2) % mod;
        long long tot = (r + l) * (r + l - 1) % mod;
        if (l | r) dp[i][l + r - 1] = (dp[i][l + r - 1] + cu * tot) % mod;
      }
    }
  }
  printf("%lld", dp[k][1]);
  return 0;
}
