#include <bits/stdc++.h>
using namespace std;
const long long mod = 1000000007;
long long d[401][401];
long long cnk[501][501];
int main() {
  vector<std::vector<long long> > cnk(501, std::vector<long long>(501, 0));
  for (int i = 0; i < 501; i++) cnk[i][0] = 1;
  for (int i = 1; i < 501; i++) {
    for (int j = 1; j < i + 1; j++) {
      cnk[i][j] = (cnk[i - 1][j] + cnk[i - 1][j - 1]) % mod;
    }
  }
  int n;
  cin >> n;
  for (int i = 0; i < 401; i++) d[i][0] = 1;
  d[1][1] = 1;
  for (int k = 2; k < 401; k++) {
    for (int l = 1; l < 401; l++) {
      for (int nl = 0; nl < l + 1; nl++) {
        d[k][l] =
            (d[k][l] + (d[k - 1][nl] * d[k - 1][l - nl]) % mod * cnk[l][nl]) %
            mod;
      }
      for (int nl = 0; nl < l + 2; nl++) {
        long long dl = (d[k - 1][nl] * l) % mod;
        long long mn = 0;
        if (nl < l) mn += d[k - 1][l - 1 - nl] * cnk[l - 1][nl];
        if (nl < l + 1) mn += d[k - 1][l - nl] * 2 * cnk[l][nl];
        if (nl > 0 && nl < l + 1)
          mn += d[k - 1][l + 1 - nl] * 2 * cnk[l - 1][nl - 1];
        if (nl > 1) mn += d[k - 1][l + 1 - nl] * 2 * cnk[l - 1][nl - 2];
        mn = mn % mod;
        d[k][l] = (d[k][l] + mn * dl) % mod;
      }
    }
  }
  cout << d[n][1];
}
