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