We Like AGC

AtCoder
IDabc122_d
Time2000ms
Memory256MB
Difficulty
You are given an integer $N$. Find the number of strings of length $N$ that satisfy the following conditions, modulo $10^9+7$: * The string does not contain characters other than `A`, `C`, `G` and `T`. * The string does not contain `AGC` as a substring. * The condition above cannot be violated by swapping two adjacent characters once. ## Constraints * $3 \leq N \leq 100$ ## Input Input is given from Standard Input in the following format: $N$ [samples] ## Notes A substring of a string $T$ is a string obtained by removing zero or more characters from the beginning and the end of $T$. For example, the substrings of `ATCODER` include `TCO`, `AT`, `CODER`, `ATCODER` and (the empty string), but not `AC`.
Samples
Input #1
3
Output #1
61

There are $4^3 = 64$ strings of length $3$ that do not contain characters other than `A`, `C`, `G` and `T`. Among them, only `AGC`, `ACG` and `GAC` violate the condition, so the answer is $64 - 3 = 61$.
Input #2
4
Output #2
230
Input #3
100
Output #3
388130742

Be sure to print the number of strings modulo $10^9+7$.
API Response (JSON)
{
  "problem": {
    "name": "We Like AGC",
    "description": {
      "content": "You are given an integer $N$. Find the number of strings of length $N$ that satisfy the following conditions, modulo $10^9+7$: *   The string does not contain characters other than `A`, `C`, `G` and ",
      "description_type": "Markdown"
    },
    "platform": "AtCoder",
    "limit": {
      "time_limit": 2000,
      "memory_limit": 262144
    },
    "difficulty": "None",
    "is_remote": true,
    "is_sync": true,
    "sync_url": null,
    "sign": "abc122_d"
  },
  "statements": [
    {
      "statement_type": "Markdown",
      "content": "You are given an integer $N$. Find the number of strings of length $N$ that satisfy the following conditions, modulo $10^9+7$:\n\n*   The string does not contain characters other than `A`, `C`, `G` and ...",
      "is_translate": false,
      "language": "English"
    }
  ]
}
Full JSON Raw Segments