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 JAVA):

Solution:
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.Arrays;
import java.util.Stack;

public class ProblemD {
    
    static long MOD = 1000000007;

    static int[] crspnd;
    static long[][][][] memo;
    static boolean[][] ok;
    static boolean[][] tnr;

    public static long dfs(int left, int right, int leftcolor, int rightcolor) {
        if (left + 1 == right) {
            if (ok[leftcolor][rightcolor] && crspnd[left] == right) {
                return 1;
            }
            return 0;
        }
        if (memo[left][right][leftcolor][rightcolor] >= 0) {
            return memo[left][right][leftcolor][rightcolor];
        }
        
        long ans = 0;
        if (crspnd[left] == right) {
            if (ok[leftcolor][rightcolor]) {
                for (int cl = 0 ; cl <= 2 ; cl++) {
                    for (int cr = 0 ; cr <= 2 ; cr++) {
                        if (tnr[leftcolor][cl] && tnr[rightcolor][cr]) {
                            ans = (ans + dfs(left+1, right-1, cl, cr)) % MOD;
                        }
                    }
                }
            }
        } else {
            for (int cl = 0 ; cl <= 2 ; cl++) {
                for (int cr = 0 ; cr <= 2 ; cr++) {
                    if (tnr[cr][cl]) {
                        long add = (dfs(left, crspnd[left], leftcolor, cr) * dfs(crspnd[left]+1, right, cl, rightcolor)) % MOD;
                        ans = (ans + add) % MOD;
                    }
                }
            }
        }
        
        ans %= MOD;
        memo[left][right][leftcolor][rightcolor] = ans;
        
        return ans;
    }
    
    public static void main(String[] args) throws IOException {
        BufferedReader s = new BufferedReader(new InputStreamReader(System.in));
        String line = s.readLine();
        int len = line.length();
        crspnd = new int[len];
        Stack<Integer> st = new Stack<Integer>();
        for (int i = 0 ; i < len ; i++) {
            if (line.charAt(i) == '(') {
                st.add(i);
            } else {
                int crsp = st.pop();
                crspnd[i] = crsp;
                crspnd[crsp] = i;
            }
        }
        
        memo = new long[701][701][3][3];
        for (int i = 0 ; i < 701 ; i++) {
            for (int j = 0 ; j < 701 ; j++) {
                for (int k = 0 ; k < 3 ; k++) {
                    memo[i][j][k][0] = -1;
                    memo[i][j][k][1] = -1;
                    memo[i][j][k][2] = -1;
                }
            }
        }

        ok = new boolean[3][3];
        ok[0][1] = true;
        ok[0][2] = true;
        ok[1][0] = true;
        ok[2][0] = true;
        
        tnr = new boolean[3][3];
        tnr[0][0] = true;
        tnr[0][1] = true;
        tnr[0][2] = true;
        tnr[1][0] = true;
        tnr[2][0] = true;
        tnr[1][2] = true;
        tnr[2][1] = true;
        
        long ans = 0;
        for (int cl = 0 ; cl <= 2 ; cl++) {
            for (int cr = 0 ; cr <= 2 ; cr++) {
                ans = (ans + dfs(0, len-1, cl, cr)) % MOD;
            }
        }
        System.out.println(ans % MOD);
    }
}