#include <bits/stdc++.h>
using namespace std;
int f[410][410], mod = 1000000007;
int main() {
  int n, i, j, k;
  scanf("%d", &n);
  f[n][0] = f[n][1] = 1;
  for (i = n - 1; i >= 1; i--)
    for (j = 0; j <= i; j++) {
      for (k = 0; k <= j; k++) {
        f[i][j] = (f[i][j] + (long long)f[i + 1][k] * f[i + 1][j - k] % mod *
                                 (k * 4 + 1)) %
                  mod;
        if (k != j)
          f[i][j] =
              (f[i][j] + (long long)f[i + 1][k] * f[i + 1][j - 1 - k]) % mod;
        f[i][j] = (f[i][j] + (long long)f[i + 1][k] * f[i + 1][j + 1 - k] %
                                 mod * k * (j + 1 - k) * 2) %
                  mod;
      }
      for (k = 2; k <= j + 1; k++)
        f[i][j] = (f[i][j] + (long long)f[i + 1][k] * f[i + 1][j + 1 - k] %
                                 mod * k * (k - 1) * 2) %
                  mod;
    }
  printf("%d\n", f[1][1]);
  return 0;
}
