#include <bits/stdc++.h>
using namespace std;
const long long mod = 1e9 + 7;
long long dp[405][405];
long long dfs(long long n, long long k) {
  if (!k) return 1;
  if (n == 1) {
    return (k == 1);
  }
  if (~dp[n][k]) return dp[n][k];
  dp[n][k] = 0;
  for (long long i = 0; i <= k; i++)
    (dp[n][k] += dfs(n - 1, i) * dfs(n - 1, k - i)) %= mod;
  for (long long i = 0; i <= k - 1; i++)
    (dp[n][k] += dfs(n - 1, i) * dfs(n - 1, k - i - 1)) %= mod;
  for (long long i = 0; i <= k; i++)
    (dp[n][k] += dfs(n - 1, i) * dfs(n - 1, k - i) % mod * k * 2) %= mod;
  for (long long i = 0; i <= k + 1; i++)
    (dp[n][k] +=
     dfs(n - 1, i) * dfs(n - 1, k + 1 - i) % mod * (k + 1) * k % mod) %= mod;
  return dp[n][k];
}
long long n;
signed main() {
  memset(dp, -1, sizeof(dp));
  scanf("%lld", &n);
  printf("%lld\n", dfs(n, 1));
  return 0;
}
