#include <bits/stdc++.h>
#pragma warning(disable : 4996)
using namespace std;
const int mod = 1000 * 1000 * 1000 + 7;
int K;
int comb[410][410], dp[410][410];
int main() {
  cin >> K;
  memset(comb, 0, sizeof(comb));
  comb[0][0] = 1;
  for (int i = 1; i < 410; i++) {
    comb[i][0] = 1;
    for (int j = 1; j <= i; j++) {
      comb[i][j] = (comb[i - 1][j - 1] + comb[i - 1][j]) % mod;
    }
  }
  memset(dp, 0, sizeof(dp));
  dp[1][0] = 1;
  dp[1][1] = 1;
  for (int i = 2; i <= K; i++) {
    for (int j = 0; j < 402; j++) {
      for (int k = 0; k <= j; k++) {
        if (k > 400 || j - k > 400) continue;
        dp[i][j] += 1LL * dp[i - 1][k] * dp[i - 1][j - k] % mod;
        dp[i][j] %= mod;
        dp[i][j] += 1LL * dp[i - 1][k] * dp[i - 1][j - k] % mod * j * 2 % mod;
        dp[i][j] %= mod;
        if (k) {
          dp[i][j] += 1LL * dp[i - 1][k - 1] * dp[i - 1][j - k] % mod;
          dp[i][j] %= mod;
        }
      }
      for (int k = 0; k <= j + 1; k++) {
        if (k > 400 || j + 2 - k > 400) continue;
        dp[i][j] += 1LL * dp[i - 1][k] * dp[i - 1][j + 1 - k] % mod *
                    comb[j + 1][2] * 2 % mod;
        dp[i][j] %= mod;
      }
    }
  }
  cout << dp[K][1];
}
