#include <bits/stdc++.h>
using namespace std;
long long dp[405][410];
int n;
int main() {
  cin >> n;
  dp[1][1] = 1;
  dp[1][0] = 1;
  for (int i = 1; i < n; i++) {
    for (int j = 0; j <= 5 + n; j++) {
      for (int k = 0; k <= 6 + n - j; k++) {
        if (dp[i][j] == 0 || dp[i][k] == 0) continue;
        long long x =
            (dp[i][j] % 1000000007) * (dp[i][k] % 1000000007) % 1000000007;
        if (j + k <= 5 + n) {
          dp[i + 1][j + k] += x;
        }
        if (j + k + 1 <= 5 + n) {
          dp[i + 1][j + k + 1] += x;
        }
        if (j + k <= 5 + n) {
          dp[i + 1][j + k] += x * (j + k) * 2LL % 1000000007;
        }
        if (0 <= j + k - 1 && j + k - 1 <= 5 + n) {
          dp[i + 1][j + k - 1] += x * (j + k) * (j + k - 1) % 1000000007;
        }
      }
    }
  }
  cout << dp[n][1] % 1000000007 << endl;
}
