#include <bits/stdc++.h>
using namespace std;
long long power(long long a, long long b, long long m) {
  long long x = 1 % m;
  a %= m;
  while (b) {
    if ((1 & b)) x = x * a % m;
    a = a * a % m;
    b >>= 1;
  }
  return x;
}
int dp[2][405];
int main() {
  int k;
  scanf("%d", &k);
  int cur = 1;
  memset(dp, 0, sizeof(dp));
  dp[1][0] = dp[1][1] = 1;
  for (int height = 2; height <= k; height++) {
    int prev = cur;
    cur ^= 1;
    dp[cur][0] = 1;
    for (int p = 1; p <= k + 1; p++) {
      dp[cur][p] = 0;
      for (int left = 0; left < p; left++) {
        dp[cur][p] +=
            (dp[prev][left] * 1LL * dp[prev][p - 1 - left]) % 1000000007;
        if (dp[cur][p] >= 1000000007) dp[cur][p] -= 1000000007;
      }
      for (int left = 0; left <= p; left++) {
        dp[cur][p] +=
            (((dp[prev][left] * 1LL * dp[prev][p - left]) % 1000000007) * 1LL *
             (2 * p + 1)) %
            1000000007;
        if (dp[cur][p] >= 1000000007) dp[cur][p] -= 1000000007;
      }
      for (int left = 0; left <= p + 1; left++) {
        dp[cur][p] +=
            (((dp[prev][left] * 1LL * dp[prev][p + 1 - left]) % 1000000007) *
             1LL * (p * (p + 1))) %
            1000000007;
        if (dp[cur][p] >= 1000000007) dp[cur][p] -= 1000000007;
      }
    }
  }
  printf("%d\n", dp[cur][1]);
}
