#include <bits/stdc++.h>
using namespace std;
inline int read() {
  int s = 0, t = 1;
  char ch = getchar();
  while (ch < '0' || ch > '9') {
    if (ch == '-') t = -1;
    ch = getchar();
  }
  while (ch >= '0' && ch <= '9')
    s = (s << 3) + (s << 1) + (ch ^ 48), ch = getchar();
  return s * t;
}
const int P = 1e9 + 7;
const int N = 405;
int n, f[N][N];
int Mod(int x) { return x >= P ? x - P : x; }
int F(int n, int k) {
  if (k == 0) return 1;
  if (n == 0) return 0;
  if (~f[n][k]) return f[n][k];
  int &r = (f[n][k] = 0);
  for (int i = 0; i <= k - 1; i++)
    r = Mod(r + 1ll * F(n - 1, i) * F(n - 1, k - 1 - i) % P);
  for (int i = 0; i <= k; i++)
    r = Mod(r + 1ll * F(n - 1, i) * F(n - 1, k - i) % P);
  for (int i = 0; i <= k; i++)
    r = Mod(r + 1ll * F(n - 1, i) * F(n - 1, k - i) % P * (2 * k) % P);
  for (int i = 0; i <= k + 1; i++)
    r = Mod(r +
            1ll * F(n - 1, i) * F(n - 1, k + 1 - i) % P * (k + 1) % P * k % P);
  return r;
}
int main() {
  n = read(), memset(f, -1, sizeof(f)), printf("%d", F(n, 1));
  return 0;
}
