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.*;

public class Template implements Runnable {

    BufferedReader in;
    PrintWriter out;
    StringTokenizer tok = new StringTokenizer("");

    void init() throws FileNotFoundException {
        try {
            in = new BufferedReader(new FileReader("input.txt"));
            out = new PrintWriter("output.txt");
        } catch (Exception e) {
            in = new BufferedReader(new InputStreamReader(System.in));
            out = new PrintWriter(System.out);
        }
    }

    class GraphBuilder {
        int n, m;
        int[] x, y;
        int index;
        int[] size;


        GraphBuilder(int n, int m) {
            this.n = n;
            this.m = m;
            x = new int[m];
            y = new int[m];
            size = new int[n];
        }

        void add(int u, int v) {
            x[index] = u;
            y[index] = v;
            size[u]++;
            size[v]++;
            index++;
        }

        int[][] build() {
            int[][] graph = new int[n][];
            for (int i = 0; i < n; i++) {
                graph[i] = new int[size[i]];
            }
            for (int i = index - 1; i >= 0; i--) {
                int u = x[i];
                int v = y[i];
                graph[u][--size[u]] = v;
                graph[v][--size[v]] = u;
            }
            return graph;
        }
    }

    String readString() throws IOException {
        while (!tok.hasMoreTokens()) {
            try {
                tok = new StringTokenizer(in.readLine());
            } catch (Exception e) {
                return null;
            }
        }
        return tok.nextToken();
    }

    int readInt() throws IOException {
        return Integer.parseInt(readString());
    }

    int[] readIntArray(int size) throws IOException {
        int[] res = new int[size];
        for (int i = 0; i < size; i++) {
            res[i] = readInt();
        }
        return res;
    }

    long[] readLongArray(int size) throws IOException {
        long[] res = new long[size];
        for (int i = 0; i < size; i++) {
            res[i] = readLong();
        }
        return res;
    }

    long readLong() throws IOException {
        return Long.parseLong(readString());
    }

    double readDouble() throws IOException {
        return Double.parseDouble(readString());
    }

    <T> List<T>[] createGraphList(int size) {
        List<T>[] list = new List[size];
        for (int i = 0; i < size; i++) {
            list[i] = new ArrayList<>();
        }
        return list;
    }

    public static void main(String[] args) {
        new Template().run();
        // new Thread(null, new Template(), "", 1l * 200 * 1024 * 1024).start();
    }

    long timeBegin, timeEnd;

    void time() {
        timeEnd = System.currentTimeMillis();
        System.err.println("Time = " + (timeEnd - timeBegin));
    }

    long memoryTotal, memoryFree;

    void memory() {
        memoryFree = Runtime.getRuntime().freeMemory();
        System.err.println("Memory = " + ((memoryTotal - memoryFree) >> 10)
                + " KB");
    }

    public void run() {
        try {
            timeBegin = System.currentTimeMillis();
            memoryTotal = Runtime.getRuntime().freeMemory();
            init();
            solve();
            out.close();
            if (System.getProperty("ONLINE_JUDGE") == null) {
                time();
                memory();
            }
        } catch (Exception e) {
            e.printStackTrace();
            System.exit(-1);
        }
    }

    int n;
    char[] s;
    int[] pair;

    int[][][][] answer;

    final int EMPTY = 0;
    final int RED = 1;
    final int GREEN = 2;

    int mod = (int) 1e9 + 7;

    int calc(int leftColor, int rightColor, int l, int r) {
        if (l + 1 == r) {
            if (leftColor + rightColor == 0) return 0;
            if (leftColor != EMPTY && rightColor != EMPTY) return 0;
            return badNeib(leftColor, rightColor) ? 0 : 1;
        }
        if (answer[leftColor][rightColor][l][r] != -1) {
            return answer[leftColor][rightColor][l][r];
        }

        int opposite = pair[l];
        if (opposite == r) {
            if (leftColor != EMPTY && rightColor != EMPTY || leftColor + rightColor == 0) {
                return answer[leftColor][rightColor][l][r] = 0;
            }
            int res = 0;
            for (int nextLeftColor = 0; nextLeftColor < 3; nextLeftColor++) {
                if (badNeib(leftColor, nextLeftColor)) continue;
                for (int nextRightColor = 0; nextRightColor < 3; nextRightColor++) {
                    if (badNeib(rightColor, nextRightColor)) continue;
                    res += calc(nextLeftColor, nextRightColor, l + 1, r - 1);
                    res %= mod;
                }
            }
            return answer[leftColor][rightColor][l][r] = res;
        } else {
            int res = 0;
            for (int nextLeftColor = 0; nextLeftColor < 3; nextLeftColor++) {
                for (int nextRightColor = 0; nextRightColor < 3; nextRightColor++) {
                    if (badNeib(nextLeftColor, nextRightColor)) continue;
                    long add = calc(leftColor, nextLeftColor, l, opposite);
                    add *= calc(nextRightColor, rightColor, opposite + 1, r);
                    add %= mod;
                    res += add;
                    res %= mod;
                }
            }
            return answer[leftColor][rightColor][l][r] = res;
        }
    }

    boolean badNeib(int x, int y) {
        return x >= 1 && x == y;
    }

    void solve() throws IOException {
        s = readString().toCharArray();
        n = s.length;
        ArrayDeque<Integer> openDeq = new ArrayDeque<>();
        pair = new int[s.length];
        for (int i = 0; i < s.length; i++) {
            if (s[i] == '(') {
                openDeq.add(i);
            } else {
                int p = openDeq.pollLast();
                pair[p] = i;
                pair[i] = p;
            }
        }

        answer = new int[3][3][n][n];
        for (int[][][] a : answer) {
            for (int[][] aa : a) {
                for (int[] aaa : aa) {
                    Arrays.fill(aaa, -1);
                }
            }
        }
        long answer = 0;
        for (int l = 0; l < 3; l++) {
            for (int r = 0; r < 3; r++) {
                //System.err.println(calc(l, r, 1, n - 2));
                answer += calc(l, r, 0, n - 1);
            }
        }
        out.println(answer % mod);

    }


}