#include <bits/stdc++.h>
using namespace std;
const int MOD = 1e9 + 7;
void add(int &a, int b) {
  a += b;
  if (a >= MOD) a -= MOD;
  if (a < 0) a += MOD;
}
int mul(int a, int b) { return (long long)a * b % MOD; }
int power(int a, int b) {
  int ans = 1;
  while (b > 0) {
    if (b & 1) ans = mul(ans, a);
    a = mul(a, a);
    b >>= 1;
  }
  return ans;
}
const int N = 405;
int dp[N][N];
int main() {
  int k;
  cin >> k;
  dp[1][0] = dp[1][1] = 1;
  for (int i = 2; i <= k; i++) {
    for (int j = 0; j <= k; j++) {
      dp[i][j] = 0;
      for (int x = 0; x <= j; x++) {
        add(dp[i][j], mul(2 * j + 1, mul(dp[i - 1][x], dp[i - 1][j - x])));
      }
      for (int x = 0; x <= j - 1; x++) {
        add(dp[i][j], mul(dp[i - 1][x], dp[i - 1][j - 1 - x]));
      }
      for (int x = 0; x <= j + 1; x++) {
        add(dp[i][j],
            mul(mul(dp[i - 1][x], dp[i - 1][j + 1 - x]), (j + 1) * j));
      }
    }
  }
  cout << dp[k][1] << endl;
}
