#include <bits/stdc++.h>
#pragma warning(disable : 4996)
#pragma comment(linker, "/STACK:336777216")
using namespace std;
int IT_MAX = 1 << 17;
const long long MOD = 1000000007;
const int INF = 0x3f3f3f3f;
const long long LL_INF = 0x3f3f3f3f3f3f3f3f;
const double PI = acos(-1);
const double ERR = 1e-10;
long long dp[405][405];
int main() {
  int i, j, k, N;
  scanf("%d", &N);
  N--;
  dp[0][0] = dp[0][1] = 1;
  for (i = 1; i <= N; i++) {
    dp[i][0] = 1;
    for (j = 1; j <= N + 1 - i; j++) {
      for (k = 0; k <= j; k++)
        dp[i][j] = (dp[i][j] + dp[i - 1][k] * dp[i - 1][j - k]) % MOD;
      for (k = 0; k <= j + 1; k++) {
        long long v = dp[i - 1][k] * dp[i - 1][j + 1 - k] % MOD;
        v = (v * j * (j + 1)) % MOD;
        dp[i][j] = (dp[i][j] + v) % MOD;
      }
      dp[i][j] = (dp[i][j] + 4 * j * dp[i - 1][j]) % MOD;
      for (k = 1; k < j; k++) {
        long long v = dp[i - 1][k] * dp[i - 1][j - k] % MOD;
        v = (v * 2 * j) % MOD;
        dp[i][j] = (dp[i][j] + v) % MOD;
      }
      for (k = 0; k < j; k++)
        dp[i][j] = (dp[i][j] + dp[i - 1][k] * dp[i - 1][j - 1 - k]) % MOD;
    }
  }
  return !printf("%lld\n", dp[N][1]);
}
