Problem: Once Petya read a problem about a bracket sequence. He gave it much thought but didn't find a solution. Today you will face it.

You are given string s. It represents a correct bracket sequence. A correct bracket sequence is the sequence of opening ("(") and closing (")") brackets, such that it is possible to obtain a correct mathematical expression from it, inserting numbers and operators between the brackets. For example, such sequences as "(())()" and "()" are correct bracket sequences and such sequences as ")()" and "(()" are not.

In a correct bracket sequence each bracket corresponds to the matching bracket (an opening bracket corresponds to the matching closing bracket and vice versa). For example, in a bracket sequence shown of the figure below, the third bracket corresponds to the matching sixth one and the fifth bracket corresponds to the fourth one.

<image>

You are allowed to color some brackets in the bracket sequence so as all three conditions are fulfilled: 

  * Each bracket is either not colored any color, or is colored red, or is colored blue. 
  * For any pair of matching brackets exactly one of them is colored. In other words, for any bracket the following is true: either it or the matching bracket that corresponds to it is colored. 
  * No two neighboring colored brackets have the same color. 



Find the number of different ways to color the bracket sequence. The ways should meet the above-given conditions. Two ways of coloring are considered different if they differ in the color of at least one bracket. As the result can be quite large, print it modulo 1000000007 (109 + 7).

Input

The first line contains the single string s (2 ≤ |s| ≤ 700) which represents a correct bracket sequence. 

Output

Print the only number — the number of ways to color the bracket sequence that meet the above given conditions modulo 1000000007 (109 + 7).

Examples

Input

(())


Output

12


Input

(()())


Output

40


Input

()


Output

4

Note

Let's consider the first sample test. The bracket sequence from the sample can be colored, for example, as is shown on two figures below. 

<image> <image>

The two ways of coloring shown below are incorrect. 

<image> <image>

Solution (in CPP):

Solution:
#include <bits/stdc++.h>
using namespace std;
const int mod = 1000000007;
int v[710], d[710][710][3][3], q[710];
char sir[710];
pair<int, int> decod(int x) {
  pair<int, int> p;
  if (x == 0 || x == 1 || x == 4)
    p.first = 0;
  else if (x == 2 || x == 5)
    p.first = 1;
  else if (x == 3 || x == 6)
    p.first = 2;
  if (x == 2 || x == 3 || x == 4)
    p.second = 0;
  else if (x == 0 || x == 5)
    p.second = 1;
  else if (x == 1 || x == 6)
    p.second = 2;
  return p;
}
int cod(int x, int y) {
  if (x == 0 && y == 1)
    return 0;
  else if (x == 0 && y == 2)
    return 1;
  else if (x == 1 && y == 0)
    return 2;
  else if (x == 2 && y == 0)
    return 3;
  else if (x == 0 && y == 0)
    return 4;
  else if (x == 1 && y == 1)
    return 5;
  else if (x == 2 && y == 2)
    return 6;
}
int bun(int x, int y) {
  if (x > 0 && y > 0 && x == y) return 0;
  return 1;
}
int main() {
  scanf("%s", sir + 1);
  int n = strlen(sir + 1), nr = 0;
  for (int i = 1; i <= n; i++)
    if (sir[i] == '(')
      q[++nr] = i;
    else {
      v[q[nr]] = i;
      v[i] = q[nr];
      nr--;
    }
  for (int i = 1; i <= n; i++)
    if (v[i] == i + 1) {
      for (int j = 0; j < 3; j++)
        for (int q = 0; q < 3; q++)
          if (j * q == 0 && (j || q)) d[i][i + 1][j][q] = 1;
    }
  for (int i = 4; i <= n; i += 2) {
    int lim = n - i + 1;
    for (int j = 1; j <= lim; j++)
      if (sir[j] == '(' && sir[j + i - 1] == ')') {
        if (v[j] == j + i - 1) {
          for (int q = 0; q < 3; q++)
            for (int k = 0; k < 3; k++)
              if (q * k == 0 && (q || k)) {
                for (int q1 = 0; q1 < 3; q1++)
                  for (int k1 = 0; k1 < 3; k1++)
                    if (bun(q, q1) && bun(k1, k))
                      d[j][j + i - 1][q][k] = (d[j][j + i - 1][q][k] +
                                               d[j + 1][j + i - 2][q1][k1]) %
                                              mod;
              }
        } else {
          int x = v[j];
          for (int q = 0; q < 3; q++)
            for (int k = 0; k < 3; k++)
              if (q * k == 0 && (q || k)) {
                for (int q1 = 0; q1 < 3; q1++)
                  for (int k1 = 0; k1 < 3; k1++)
                    if (bun(k, q1))
                      d[j][j + i - 1][q][k1] =
                          (d[j][j + i - 1][q][k1] +
                           1LL * d[j][x][q][k] * d[x + 1][j + i - 1][q1][k1]) %
                          mod;
              }
        }
      }
  }
  int s = 0;
  for (int i = 0; i < 3; i++)
    for (int j = 0; j < 3; j++) s = (s + d[1][n][i][j]) % mod;
  printf("%d", s);
  return 0;
}