#include <bits/stdc++.h>
using namespace std;
long long K = 1000000007;
int32_t main() {
  long long n;
  cin >> n;
  long long dp[n][n + 1];
  for (long long i = 0; i < n; i++) {
    for (long long j = 0; j <= n; j++) {
      dp[i][j] = 0;
    }
  }
  dp[0][0] = 1;
  dp[0][1] = 1;
  for (long long i = 1; i < n; i++) {
    for (long long j = 0; j <= n; j++) {
      for (long long k = 0; k <= n; k++) {
        if (j + k - 1 > n) break;
        long long p = (dp[i - 1][j] * dp[i - 1][k]) % K;
        if (j + k + 1 <= n) {
          dp[i][j + k + 1] += p;
          dp[i][j + k + 1] %= K;
        }
        if (j + k <= n) {
          dp[i][j + k] += p;
        }
        if (j + k <= n) {
          long long pl = p * j * 2;
          dp[i][j + k] += pl;
        }
        if (j + k <= n) {
          long long pl = p * k * 2;
          dp[i][j + k] += pl;
          dp[i][j + k] %= K;
        }
        if (j + k - 1 >= 0 && j + k - 1 <= n) {
          long long ex = p * (j + k) * (j + k - 1);
          dp[i][j + k - 1] += ex;
          dp[i][j + k - 1] %= K;
        }
      }
    }
  }
  cout << dp[n - 1][1] << endl;
  return 0;
}
