#include <bits/stdc++.h>
using namespace std;
long long int mod = 1e9 + 7;
const int maxn = 420;
long long int dp[maxn][maxn];
long long int calc(int x) {
  long long int res = x * (x - 1);
  return res;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int k;
  cin >> k;
  dp[1][1] = 1;
  dp[1][0] = 1;
  for (int i = 2; i <= k; i++) {
    for (int j = 0; j <= k; j++) {
      for (int l = 0; l <= j; l++) {
        dp[i][j] += (dp[i - 1][l] * dp[i - 1][j - l]) % mod;
        dp[i][j] += (((dp[i - 1][l] * l * 2) % mod) * dp[i - 1][j - l]) % mod;
        dp[i][j] +=
            (((dp[i - 1][l] * dp[i - 1][j - l]) % mod) * (j - l) * 2) % mod;
        if (l != j) {
          dp[i][j] += (dp[i - 1][l] * dp[i - 1][j - l - 1]) % mod;
        }
        dp[i][j] +=
            (((calc(j + 1) * dp[i - 1][l]) % mod) * dp[i - 1][j - l + 1]) % mod;
        if (l == j) {
          dp[i][j] +=
              (((calc(j + 1) * dp[i - 1][j + 1]) % mod) * dp[i - 1][0]) % mod;
        }
      }
      dp[i][j] %= mod;
    }
  }
  cout << dp[k][1];
  return 0;
}
