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.*;
import java.util.*;
import java.math.*;

public class Main
{
	BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
	StringTokenizer tokenizer=null;
	
	public static void main(String[] args) throws IOException
	{
		new Main().execute();
	}
	
	void debug(Object...os)
	{
		System.out.println(Arrays.deepToString(os));
	}
	
	int ni() throws IOException
	{
		return Integer.parseInt(ns());
	}
	
	long nl() throws IOException 
	{
		return Long.parseLong(ns());
	}
	
	double nd() throws IOException 
	{
		return Double.parseDouble(ns());
	}
		
	String ns() throws IOException 
	{
		while (tokenizer == null || !tokenizer.hasMoreTokens()) 
			tokenizer = new StringTokenizer(br.readLine());
		return tokenizer.nextToken();
	}
	
	String nline() throws IOException
	{
		tokenizer=null;
		return br.readLine();
	}
		
	//Main Code starts Here
	int totalCases, testNum;	
	String s;
	int match[];

	void execute() throws IOException
	{
		totalCases = 1;
		for(testNum = 1; testNum <= totalCases; testNum++)
		{
			if(!input())
				break;
			solve();
		}
	}
	long MAXINT = 1000000007;
	long dp[][][];
	boolean done[][];
	
	void solve() throws IOException
	{
		int n = s.length();
		match = new int[n];
		int arr[] = new int[n];
		
		int index = 0;
		for(int i = 0;i<n;i++)
		{
			if(s.charAt(i) == '(')
			{
				arr[index++] = i;
			}
			else
			{
				index--;
				match[arr[index]] = i;
				match[i] = arr[index];
			}			
		}
		
		dp = new long[n][n][9];
		done = new boolean[n][n];
		calculate(0,n-1);
		long sum = 0;
		for(int i = 0;i<9;i++)		
			sum = (sum+dp[0][n-1][i])%MAXINT;
		
		System.out.println(sum);
	}
	
	void calculate(int a,int b)
	{
		if(!done[a][b])
		{
			done[a][b] = true;
			if(a+1 == b)
			{				
				for(int i = 0;i<4;i++)			
					dp[a][b][i] = 1;			
				for(int i = 4;i<9;i++)		
					dp[a][b][i] = 0;			
			}
			else if(a == match[b])
			{
				calculate(a+1,b-1);
				for(int i = 4;i<9;i++)		
					dp[a][b][i] = 0;
				
				dp[a][b][0] = (dp[a+1][b-1][1] + (dp[a+1][b-1][2] + (dp[a+1][b-1][3] + (dp[a+1][b-1][4] + (dp[a+1][b-1][7] + dp[a+1][b-1][8])%MAXINT)%MAXINT)%MAXINT)%MAXINT)%MAXINT;
				dp[a][b][1] = (dp[a+1][b-1][0] + (dp[a+1][b-1][2] + (dp[a+1][b-1][3] + (dp[a+1][b-1][5] + (dp[a+1][b-1][6] + dp[a+1][b-1][8])%MAXINT)%MAXINT)%MAXINT)%MAXINT)%MAXINT;
				dp[a][b][2] = (dp[a+1][b-1][0] + (dp[a+1][b-1][1] + (dp[a+1][b-1][3] + (dp[a+1][b-1][5] + (dp[a+1][b-1][7] + dp[a+1][b-1][8])%MAXINT)%MAXINT)%MAXINT)%MAXINT)%MAXINT;
				dp[a][b][3] = (dp[a+1][b-1][0] + (dp[a+1][b-1][1] + (dp[a+1][b-1][2] + (dp[a+1][b-1][4] + (dp[a+1][b-1][6] + dp[a+1][b-1][8])%MAXINT)%MAXINT)%MAXINT)%MAXINT)%MAXINT;
			}
			else
			{
				calculate(a,match[a]);
				calculate(match[a]+1,b);
				int mk = match[a];
				
				dp[a][b][0] = ((dp[a][mk][0] *(dp[mk+1][b][0] + dp[mk+1][b][5])%MAXINT)%MAXINT + (dp[a][mk][1] *(dp[mk+1][b][0] + dp[mk+1][b][6])%MAXINT)%MAXINT)%MAXINT;
				dp[a][b][1] = ((dp[a][mk][1] *(dp[mk+1][b][1] + dp[mk+1][b][4])%MAXINT)%MAXINT + (dp[a][mk][0] *(dp[mk+1][b][1] + dp[mk+1][b][7])%MAXINT)%MAXINT)%MAXINT;
				dp[a][b][2] = (dp[a][mk][2] * (((dp[mk+1][b][8] + dp[mk+1][b][2])%MAXINT + dp[mk+1][b][3])%MAXINT))%MAXINT;
				dp[a][b][3] = (dp[a][mk][3] * (((dp[mk+1][b][8] + dp[mk+1][b][2])%MAXINT + dp[mk+1][b][3])%MAXINT))%MAXINT;
				dp[a][b][4] = (dp[a][mk][2] * (((dp[mk+1][b][1] + dp[mk+1][b][4])%MAXINT + dp[mk+1][b][7])%MAXINT))%MAXINT;
				dp[a][b][5] = (dp[a][mk][3] * (((dp[mk+1][b][0] + dp[mk+1][b][5])%MAXINT + dp[mk+1][b][6])%MAXINT))%MAXINT;
				dp[a][b][6] = (dp[a][mk][2] * (((dp[mk+1][b][0] + dp[mk+1][b][5])%MAXINT + dp[mk+1][b][6])%MAXINT))%MAXINT;
				dp[a][b][7] = (dp[a][mk][3] * (((dp[mk+1][b][1] + dp[mk+1][b][4])%MAXINT + dp[mk+1][b][7])%MAXINT))%MAXINT;
				dp[a][b][8] = ((dp[a][mk][0] *(dp[mk+1][b][3] + dp[mk+1][b][8])%MAXINT)%MAXINT + (dp[a][mk][1] *(dp[mk+1][b][2] + dp[mk+1][b][8])%MAXINT)%MAXINT)%MAXINT;
			}
		}
	}
	
	boolean input() throws IOException
	{
		s = ns();		
		return true;
	}
}