#include <bits/stdc++.h>
#pragma GCC optimize("O3")
using namespace std;
unsigned seed = chrono::system_clock::now().time_since_epoch().count();
mt19937 eng(seed);
long long random2() { return (1ll << 31ll) * eng() + eng(); }
long long n, m, k, q, T;
const long long big = 1000000007;
const long long big2 = 1000000009;
const long long mod = 998244353;
const int MAXN = 300001;
long long PATH[401][401] = {0};
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  long long a, b, c, d, e;
  cin >> k;
  for (int c1 = 0; c1 < (401); ++c1) {
    for (int c2 = 0; c2 < (401); ++c2) {
      if (c1 == 0 && c2 == 1) PATH[c1][c2] = 1;
      if (c2 == 0) PATH[c1][c2] = 1;
    }
  }
  for (int i = 1; i < (k); ++i) {
    for (long long r = 1; r < k + 1; r++) {
      for (int x = 0; x < (r + 2); ++x) {
        if (x < r)
          PATH[i][r] += (PATH[i - 1][x] * PATH[i - 1][r - 1 - x]) % big;
        if (x < r + 1)
          PATH[i][r] +=
              (1 + 2 * r) * ((PATH[i - 1][x] * PATH[i - 1][r - x]) % big);
        PATH[i][r] %= big;
        PATH[i][r] +=
            r * (r + 1) * ((PATH[i - 1][x] * PATH[i - 1][r - x + 1]) % big);
        PATH[i][r] %= big;
      }
    }
  }
  cout << PATH[k - 1][1] << "\n";
  return 0;
}
