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.InputStreamReader;
import java.io.IOException;
import java.util.Arrays;
import java.io.BufferedReader;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.io.Writer;
import java.util.StringTokenizer;
import java.math.BigInteger;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 * @author lpeter83
 */
public class Main {
	public static void main(String[] args) {
		InputStream inputStream = System.in;
		OutputStream outputStream = System.out;
		InputReader in = new InputReader(inputStream);
		OutputWriter out = new OutputWriter(outputStream);
		TaskD solver = new TaskD();
		solver.solve(1, in, out);
		out.close();
	}
}

class TaskD {
    public void solve(int testNumber, InputReader in, OutputWriter out) {
        char[] s = in.next().toCharArray();
        f = new int[s.length + 1][s.length + 1][3][3];
        for (int i1 = 0; i1 < s.length + 1; i1++) {
            for (int i2 = 0; i2 < s.length + 1; i2++) {
                for (int i3 = 0; i3 < 3; i3++) {
                    for (int i4 = 0; i4 < 3; i4++) {
                        f[i1][i2][i3][i4] = -1;
                    }
                }
            }
        }
        next = new int[s.length];
        Arrays.fill(next, -1);
        int r = 0, l = 0;
        for (int i = 0; i < s.length; i++) {
            r = 0;
            l = 0;
            if (s[i] == ')') continue;
            for (int j = i + 1; j < s.length; j++) {
                if (s[j] == '(') l++;
                if (s[j] == ')') r++;
                if (r == l + 1) {
                    next[i] = j;
                    break;
                }
            }
        }
        //out.printLine(Arrays.toString(next));
        long ans = 0;
        for (int c1 = 0; c1 < 3; c1++) {
            for (int c2 = 0; c2 < 3; c2++) {
                ans += rec(0, s.length - 1, c1, c2);
                ans %= mod;
            }
        }
        out.printLine(ans);
    }

    int[] next;
    int[][][][] f;
    int mod = 1000000007;

    long rec(int l, int r, int color1, int color2) {
        //System.out.println("l = " + l + " r = " + r + " color1 = " + color1 + " color2 = " + color2);
        if (f[l][r][color1][color2] != -1) return f[l][r][color1][color2];
        if (l >= r) return 0;
        if (l == r - 1) {
            if (color1 == color2 || (color1 != 0 && color2 != 0)) return f[l][r][color1][color2] = 0;
            else return f[l][r][color1][color2] = 1;
        }
        long ans = 0;
        int nx = next[l];
        if (nx == r) {
            if (color1 == 0 && color2 != 0 || color1 != 0 && color2 == 0) {
                for (int c3 = 0; c3 < 3; c3++) {
                    for (int c4 = 0; c4 < 3; c4++) {
                        if (color1 == c3 && color1 > 0) continue;
                        if (color2 == c4 && color2 > 0) continue;
                        if (next[l + 1] == r - 1) {
                            if (c3 == 0 && c4 != 0 || c4 == 0 && c3 != 0) {
                                ans += rec(l + 1, r - 1, c3, c4);
                                ans %= mod;
                            }
                        } else {
                            ans += rec(l + 1, r - 1, c3, c4);
                            ans %= mod;
                        }
                    }
                }
            }
        } else {
            for (int c3 = 0; c3 < 3; c3++) {
                for (int c4 = 0; c4 < 3; c4++) {
                    if (c3 == c4 && c3 > 0) continue;
                    if (color1 != 0 && c3 != 0) continue;
                    ans += rec(l, next[l], color1, c3) * rec(next[l] + 1, r, c4, color2);
                    ans %= mod;
                }
            }
        }
        //System.out.println("l = " + l + " r = " + r + " color1 = " + color1 + " color2 = " + color2);
        //System.out.println(ans);
        return f[l][r][color1][color2] = (int)ans;
    }
}

class InputReader {
    BufferedReader reader;
    StringTokenizer tokenizer;

    public InputReader(InputStream stream) {
        reader = new BufferedReader(new InputStreamReader(stream));
        tokenizer = null;
    }

    public String next() {
        while (tokenizer == null || !tokenizer.hasMoreTokens()) {
            try {
                tokenizer = new StringTokenizer(reader.readLine());
            } catch (IOException e) {
                throw new RuntimeException(e);
            }
        }
        return tokenizer.nextToken();
    }

    }

class OutputWriter {
    private final PrintWriter writer;

    public OutputWriter(OutputStream outputStream) {
        writer = new PrintWriter(outputStream);
    }

    public OutputWriter(Writer writer) {
        this.writer = new PrintWriter(writer);
    }

    public void print(Object... objects) {
        for (int i = 0; i < objects.length; i++) {
            if (i != 0)
                writer.print(' ');
            writer.print(objects[i]);
        }
    }

    public void printLine(Object... objects) {
        print(objects);
        writer.println();
    }

    public void close() {
        writer.close();
    }
}