#include <bits/stdc++.h>
using namespace std;
const int N = 405;
const int mod = 1000 * 1000 * 1000 + 7;
inline void add(int &x, int y) {
  x += y;
  if (x >= mod) x -= mod;
}
int n, f[N][2 * N];
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cin >> n;
  f[1][1] = f[1][0] = 1;
  for (int i = 2; i <= n; ++i) {
    for (int l = 0; l <= n; ++l) {
      for (int r = 0; r <= n - l + 1; ++r) {
        int now = 1LL * f[i - 1][l] * f[i - 1][r] % mod;
        add(f[i][l + r], now);
        add(f[i][l + r + 1], now);
        add(f[i][l + r], 2LL * now * l % mod);
        add(f[i][l + r], 2LL * now * r % mod);
        if (l + r - 1 >= 0) {
          int here = (l + r) * (l + r - 1);
          int cur = 1LL * now * here % mod;
          add(f[i][l + r - 1], cur);
        }
      }
    }
  }
  cout << f[n][1] << '\n';
  return 0;
}
