#include <bits/stdc++.h>
using namespace std;
int const N = 444;
int const MOD = 1e9 + 7;
int w[N][N], d[N][N], c[N][N];
void add(int &a, int b) {
  a += b;
  if (a >= MOD) a -= MOD;
}
int mul(int a, int b) { return a * 1LL * b % MOD; }
void precalc() {
  for (int i = 0; i < N; ++i) {
    c[0][i] = 1;
    for (int j = 1; j < i + 1; ++j)
      c[j][i] = (c[j - 1][i - 1] + c[j][i - 1]) % MOD;
  }
}
int rec(int h, int b) {
  if (h == 0) {
    if (b == 0)
      return 1;
    else
      return 0;
  }
  if (w[h][b]) return d[h][b];
  w[h][b] = 1;
  int ret = 0;
  int s1 = 0;
  for (int i = 0; i < b + 1; ++i) {
    int v = c[i][b];
    v = mul(v, rec(h - 1, i));
    v = mul(v, rec(h - 1, b - i));
    add(s1, v);
  }
  int s2 = 0;
  --b;
  for (int i = 0; i < b + 1; ++i) {
    int v = c[i][b];
    v = mul(v, rec(h - 1, i));
    v = mul(v, rec(h - 1, b - i));
    add(s2, v);
  }
  ++b;
  s2 = mul(s2, b);
  int s3 = mul(s1, mul(2, b));
  int s4 = 0;
  ++b;
  for (int i = 0; i < b + 1; ++i) {
    int v = c[i][b];
    v = mul(v, rec(h - 1, i));
    v = mul(v, rec(h - 1, b - i));
    add(s4, v);
  }
  --b;
  s4 = mul(s4, b);
  add(ret, s1);
  add(ret, s2);
  add(ret, s3);
  add(ret, s4);
  return d[h][b] = ret;
}
void solve() {
  precalc();
  int h;
  cin >> h;
  int ans = rec(h, 1);
  cout << ans << endl;
}
int main() {
  solve();
  return 0;
}
