output_description: Print the number of strings of length N that satisfy the following conditions,
  modulo 10^9+7.
  
  * * *
input_description: Input is given from Standard Input in the following format:
  
      
      
      N
attempt: # 18:29
  n = int(input())
  mod = 10**9 + 7
  now = [[[0 for _ in range(4)] for _ in range(4)] for _ in range(4)]
  now[3][3][3] = 1
  # print(part)
  boo = [
      [0, 0, 1, 2],
      [1, 0, 1, 2],
      [2, 0, 1, 2],
      [3, 0, 1, 2],
      [0, 0, 1, 2],
      [0, 1, 1, 2],
      [0, 2, 1, 2],
      [0, 3, 1, 2],
      [0, 1, 0, 2],
      [0, 1, 1, 2],
      [0, 1, 2, 2],
      [0, 1, 3, 2],
      [0, 1, 0, 2],
      [1, 1, 0, 2],
      [2, 1, 0, 2],
      [3, 1, 0, 2],
      [0, 0, 2, 1],
      [1, 0, 2, 1],
      [2, 0, 2, 1],
      [3, 0, 2, 1],
  ]
  # print(now)
  for i in range(n):
      last = now
      now = [[[0 for _ in range(4)] for _ in range(4)] for _ in range(4)]
      # print(i,'l',last)
      # print(i,'n',now)
      for i in range(4):
          for j in range(4):
              for k in range(4):
                  for l in range(4):
                      if [i, j, k, l] not in boo:
                          now[j][k][l] += last[i][j][k]
                          now[j][k][l] %= mod
  ans = 0
  for i in range(4):
      for j in range(4):
          for k in range(4):
              ans += now[i][j][k]
              ans %= mod
  # print(last)
  # print(now)
  print(ans)
  
problem_description: Statement
  
  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.
samples: [{"input": "3", "output": "61\n    \n\nThere are 4^3 = 64 strings of length 3 that do not contain characters other\nthan `A`, `C`, `G` and `T`. Among them, only `AGC`, `ACG` and `GAC` violate\nthe condition, so the answer is 64 - 3 = 61.\n\n* * *"}, {"input": "4", "output": "230\n    \n\n* * *"}, {"input": "100", "output": "388130742\n    \n\nBe sure to print the number of strings modulo 10^9+7."}]