Consider the ~3N~ lattice points with x-coordinates between 0 and 2 and y-coordinates between 0 and ~N-1~. Define two points to be neighbors if their x-coordinates differ by at most 1 and their y-coordinates differ by at most 1. Compute the number of ways to connect all ~3N~ points to form a polygon such that the polygon is simple and any two adjacent points in the polygon are neighbors.
~1 \le N \le 10^9~
For at most 30% of marks, ~N \le 200~.
For at most 70% of marks, ~N \le 10^5~.
The first line will contain a single integer, ~N~.
Output the number of polygons mod ~10^9~.