#include <bits/stdc++.h>   using namespace std;   long long gcd(long long a, long long b) { return b == 0 ? a : gcd(b, a % b); }   const int inf = 0x7fffffff;   const int maxn = 505;   const long long mod = 1e9 + 7;   long long dp[maxn][maxn];   int n;   int main() {     ios::sync_with_stdio(false);     cin >> n;     dp[1][1] = dp[1][0] = 1;     for (int i = 2; i <= n; i++) {       for (int j = 0; j <= n; j++) {         for (int k = 0; k + j <= n; k++) {           long long x = (dp[i - 1][j] * dp[i - 1][k]) % mod;           dp[i][k + j] += x * (2 * (k + j) + 1);           dp[i][k + j] %= mod;           dp[i][k + j + 1] = (dp[i][k + j + 1] + x) % mod;           dp[i][k + j - 1] += x * (k + j) * (k + j - 1);           dp[i][k + j - 1] %= mod;         }       }     }     cout << dp[n][1] << endl;     return 0;   }   