#include <bits/stdc++.h>
using namespace std;
long long int dp[420][420 * 2];
int main() {
  dp[1][0] = 1;
  dp[1][1] = 1;
  int k2 = 0;
  cin >> k2;
  for (int i = 2; i <= k2; i++) {
    for (int j = 0; j < 420; j++) {
      if (dp[i - 1][j]) {
        for (int k = 0; k < 420; k++) {
          if (dp[i - 1][k]) {
            if (j + k <= (k2 - i) + 2) {
              long long int A = dp[i - 1][j] * dp[i - 1][k];
              if (A >= 1000000007) A %= 1000000007;
              dp[i][j + k] += A;
              if (dp[i][j + k] >= 1000000007) dp[i][j + k] -= 1000000007;
              if (j + k + 1 < 420 * 2) {
                dp[i][j + k + 1] += A;
                if (dp[i][j + k + 1] >= 1000000007)
                  dp[i][j + k + 1] -= 1000000007;
              }
              dp[i][j + k] += A * (k + j) * 2LL;
              if (dp[i][j + k] >= 1000000007) {
                dp[i][j + k] %= 1000000007;
              }
              dp[i][j + k - 1] += A * (j + k) * (j + k - 1);
              if (dp[i][j + k - 1] >= 1000000007) {
                dp[i][j + k - 1] %= 1000000007;
              }
            }
          }
        }
      }
    }
  }
  cout << dp[k2][1] << endl;
  return 0;
}
