#include <bits/stdc++.h>
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx")
#pragma GCC optimize("Ofast,no-stack-protector")
#pragma GCC target("avx,tune=native")
using namespace std;
using ll = long long;
const ll mod = 1000000007;
ll add(ll a, ll b) {
  a += b;
  if (a >= mod) a -= mod;
  return a;
}
ll sub(ll a, ll b) {
  a -= b;
  if (a < 0) a += mod;
  return a;
}
ll mul(ll a, ll b) { return a * b % mod; }
ll pw(ll a, ll b, ll md) {
  ll ans = 1;
  for (; b; b >>= 1, a = (a * a) % md)
    if (b & 1) ans = (ans * a) % md;
  return ans;
}
const int maxn = 803;
ll dp[maxn][maxn];
int main() {
  int k;
  scanf("%d", &k);
  dp[1][0] = dp[1][1] = 1;
  for (int e = 2; e <= k; e++) {
    for (int l = 0; l <= k; l++) {
      for (int r = 0; r <= k; r++) {
        ll x = dp[e - 1][l] * dp[e - 1][r] % mod;
        dp[e][l + r + 1] += x;
        dp[e][l + r] += x;
        dp[e][l + r] += 2 * x * l;
        dp[e][l + r] += 2 * x * r;
        if (l + r > 0) dp[e][l + r - 1] += x * (l + r) * (l + r - 1);
      }
    }
    for (int f = 0; f <= k; f++) dp[e][f] %= mod;
  }
  printf("%lld\n", dp[k][1]);
  return 0;
}
