#include <bits/stdc++.h>
using namespace std;
const int MAXN = 405;
const int MOD = (int)1e9 + 7;
long long dp[MAXN][MAXN];
int main() {
  int n;
  cin >> n;
  dp[1][1] = 1;
  for (int i = 2; i <= n; i++) {
    for (int j = 1; j <= n + 1 - i; j++) {
      for (int l = 0; l <= j; l++) {
        int r = j - l;
        long long w1, w2;
        w1 = (l == 0 ? 1 : dp[i - 1][l]);
        w2 = (r == 0 ? 1 : dp[i - 1][r]);
        dp[i][j] += w1 * w2 % MOD;
        w1 = (l == 0 ? 1 : dp[i - 1][l]);
        w2 = (r == 0 ? 1 : dp[i - 1][r]);
        if (l > 0) dp[i][j] += w1 * w2 % MOD * l * 2 % MOD;
        if (r > 0) dp[i][j] += w1 * w2 % MOD * r * 2 % MOD;
      }
      for (int l = 0; l <= j - 1; l++) {
        int r = j - 1 - l;
        long long w1, w2;
        w1 = (l == 0 ? 1 : dp[i - 1][l]);
        w2 = (r == 0 ? 1 : dp[i - 1][r]);
        dp[i][j] += w1 * w2 % MOD;
      }
      for (int l = 0; l <= j + 1; l++) {
        int r = (j + 1) - l;
        long long w1 = dp[i - 1][l], w2 = dp[i - 1][r];
        if (l > 0 && r > 0) {
          dp[i][j] += w1 * w2 % MOD * l % MOD * r % MOD * 2;
        }
        w1 = (l == 0 ? 1 : dp[i - 1][l]);
        w2 = (r == 0 ? 1 : dp[i - 1][r]);
        if (l >= 2) {
          dp[i][j] += w1 * w2 % MOD * l % MOD * (l - 1) % MOD;
        }
        if (r >= 2) {
          dp[i][j] += w1 * w2 % MOD * r % MOD * (r - 1) % MOD;
        }
      }
      dp[i][j] = (dp[i][j] % MOD + MOD) % MOD;
    }
  }
  cout << dp[n][1] << '\n';
}
