#include <bits/stdc++.h>
using namespace std;
const long long N = 402;
const long long mod = 1e9 + 7;
long long dp[N][N];
signed main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  long long n, i, j, k, l;
  cin >> n;
  dp[1][0] = 1;
  dp[1][1] = 1;
  for (i = 2; i <= n; i++) {
    for (j = 0; j <= n; j++) {
      for (k = 0; k <= n; k++) {
        l = (dp[i - 1][j] * dp[i - 1][k]) % mod;
        if (j + k <= n) {
          dp[i][j + k] += l;
          dp[i][j + k] %= mod;
        }
        if (j + k + 1 <= n) {
          dp[i][j + k + 1] += l;
          dp[i][j + k + 1] % mod;
        }
        if (j + k <= n) {
          dp[i][j + k] += (l * 2 * j + l * 2 * k);
          dp[i][j + k] %= mod;
        }
        if (j + k - 1 <= n) {
          dp[i][j + k - 1] += (l * (j + k - 1) * (j + k));
          dp[i][j + k - 1] %= mod;
        }
      }
    }
  }
  cout << dp[n][1];
}
