#include using namespace std; typedef long long int ll; typedef vector vl; #define INF 1LL<<63 #define MOD 1000000007 ll n, d, ans, cnt; ll a[10000000]; bool is_ok() { for (ll i = 0; i < n * 2; i++) { cnt = 0; for (ll j = i; j < n * 2; j++) { if (a[i] == a[j]) cnt++; if (cnt >= 3) return false; } } return true; } ll solve(ll d) { if (d >= n * 2 && is_ok()) { ans ++; ans %= MOD; return 0; } if (d >= n * 2) return 0; for (ll i = 0; i < n; i++) { a[d-1] = i; solve(d + 1); } } int main() { scanf("%lld", &n); for (ll i = 0; i < n; i++) { a[i] = INF; } d = 0; solve(d); printf("%lld\n", ans); return 0; }