Problem: Oleg Petrov loves crossword puzzles and every Thursday he buys his favorite magazine with crosswords and other word puzzles. In the last magazine Oleg found a curious puzzle, and the magazine promised a valuable prize for it's solution. We give a formal description of the problem below.

The puzzle field consists of two rows, each row contains n cells. Each cell contains exactly one small English letter. You also are given a word w, which consists of k small English letters. A solution of the puzzle is a sequence of field cells c1, ..., ck, such that:

  * For all i from 1 to k the letter written in the cell ci matches the letter wi;
  * All the cells in the sequence are pairwise distinct;
  * For all i from 1 to k - 1 cells ci and ci + 1 have a common side.



Oleg Petrov quickly found a solution for the puzzle. Now he wonders, how many distinct solutions are there for this puzzle. Oleg Petrov doesn't like too large numbers, so calculate the answer modulo 109 + 7.

Two solutions ci and c'i are considered distinct if the sequences of cells do not match in at least one position, that is there is such j in range from 1 to k, such that cj ≠ c'j.

Input

The first two lines contain the state of the field for the puzzle. Each of these non-empty lines contains exactly n small English letters.

The next line is left empty.

The next line is non-empty and contains word w, consisting of small English letters.

The length of each line doesn't exceed 2 000.

Output

Print a single integer — the number of distinct solutions for the puzzle modulo 109 + 7.

Examples

Input

code
edoc

code


Output

4


Input

aaa
aaa

aa


Output

14

Solution (in CPP):

Solution:
#include <bits/stdc++.h>
#pragma warning(disable : 4996)
using namespace std;
const int MAX_LEN = 2000 + 8;
char A[2][MAX_LEN];
char W[MAX_LEN];
int L1[2][MAX_LEN][MAX_LEN];
int R1[2][MAX_LEN][MAX_LEN];
long long L2[2][MAX_LEN][MAX_LEN];
long long R2[2][MAX_LEN][MAX_LEN];
int N, M;
const long long MOD = 1000000007;
long long PL(long long a, long long b) { return (a + b + MOD) % MOD; }
long long getL2(int t, int i, int j) {
  if (L2[t][i][j] != -1) return L2[t][i][j];
  if (i < 0 || i >= N) return 0;
  if (j >= M) return 1;
  if (A[t][i] != W[j]) return L2[t][i][j] = 0;
  if (j + 1 >= M) {
    return L2[t][i][j] = 1;
  }
  L2[t][i][j] = 0;
  long long &l2 = L2[t][i][j];
  l2 = PL(l2, getL2(t, i - 1, j + 1));
  int rlen = M - j;
  if (rlen > 2 && A[1 - t][i] == W[j + 1]) {
    l2 = PL(l2, getL2(1 - t, i - 1, j + 2));
  }
  if (rlen % 2 == 0) {
    int half = rlen / 2;
    if (L1[t][i][j] >= half) {
      if (i - half + 1 >= 0 && R1[1 - t][i - half + 1][j + half] >= half) {
        l2 = PL(l2, 1);
      }
    }
  }
  return l2;
}
long long getR2(int t, int i, int j) {
  if (R2[t][i][j] != -1) return R2[t][i][j];
  if (i < 0 || i >= N) return 0;
  if (j >= M) return 1;
  if (A[t][i] != W[j]) return R2[t][i][j] = 0;
  if (j + 1 >= M) {
    return R2[t][i][j] = 1;
  }
  R2[t][i][j] = 0;
  long long &r2 = R2[t][i][j];
  r2 = PL(r2, getR2(t, i + 1, j + 1));
  int rlen = M - j;
  if (rlen > 2 && A[1 - t][i] == W[j + 1]) {
    r2 = PL(r2, getR2(1 - t, i + 1, j + 2));
  }
  if (rlen % 2 == 0) {
    int half = rlen / 2;
    if (R1[t][i][j] >= half) {
      if (i + half - 1 >= 0 && L1[1 - t][i + half - 1][j + half] >= half) {
        r2 = PL(r2, 1);
      }
    }
  }
  return r2;
}
long long getCount(int y, int x) {
  long long res = 0;
  res = PL(res, getL2(y, x, 0));
  res = PL(res, getR2(y, x, 0));
  if ((M == 1 && W[0] == A[y][x]) ||
      (M == 2 && W[0] == A[y][x] && W[1] == A[1 - y][x])) {
    res = PL(res, -1);
  }
  for (int p = 1;; p++) {
    if (x + p >= N && x - p < 0) break;
    if (x > 0 && x + p < N) {
      if (R1[y][x][0] > p && L1[1 - y][x + p][p + 1] > p + 1) {
        res = PL(res, getL2(1 - y, x - 1, 2 * p + 2));
      }
    }
    if (x + 1 < N && x - p >= 0) {
      if (L1[y][x][0] > p && R1[1 - y][x - p][p + 1] > p + 1) {
        res = PL(res, getR2(1 - y, x + 1, 2 * p + 2));
      }
    }
  }
  return res;
}
int main() {
  memset(L2, -1, sizeof(L2));
  memset(R2, -1, sizeof(R2));
  scanf("%s%s%s", A[0], A[1], W);
  N = strlen(A[0]);
  M = strlen(W);
  for (int i = M - 1; i >= 0; i--) {
    for (int t = 0; t < 2; t++) {
      for (int j = 0; j < N; j++) {
        if (A[t][j] == W[i]) {
          R1[t][j][i] = R1[t][j + 1][i + 1] + 1;
          if (j == 0)
            L1[t][j][i] = 1;
          else
            L1[t][j][i] = L1[t][j - 1][i + 1] + 1;
        }
      }
    }
  }
  long long sol = 0;
  for (int t = 0; t < 2; t++) {
    for (int i = 0; i < N; i++) {
      sol = PL(sol, getCount(t, i));
    }
  }
  printf("%I64d\n", sol);
  return 0;
}