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>
using namespace std;
const int MAXN = 2e3 + 5, Mod = 1e9 + 7;
char buf[1 << 12], *pp1 = buf, *pp2 = buf, nc;
int ny;
inline char gc() {
  return pp1 == pp2 &&
                 (pp2 = (pp1 = buf) + fread(buf, 1, 1 << 12, stdin), pp1 == pp2)
             ? EOF
             : *pp1++;
}
inline int read() {
  int x = 0;
  for (ny = 1; nc = gc(), (nc < 48 || nc > 57) && nc != EOF;)
    if (nc == 45) ny = -1;
  if (nc < 0) return nc;
  for (x = nc - 48; nc = gc(), 47 < nc && nc < 58 && nc != EOF;
       x = (x << 3) + (x << 1) + (nc ^ 48))
    ;
  return x * ny;
}
char S[2][MAXN], T[MAXN];
int n, m, ans, F[2][MAXN][MAXN], G[2][MAXN][MAXN], LCS1[2][MAXN][MAXN],
    LCS2[2][MAXN][MAXN], LCP1[2][MAXN][MAXN], LCP2[2][MAXN][MAXN],
    U1[2][MAXN][MAXN], U2[2][MAXN][MAXN];
inline void Solve() {
  for (int i = 0; i <= 1; i++) {
    for (int k = m; k >= 1; k--) {
      for (int j = n; j >= 1; j--)
        LCP1[i][j][k] = (S[i][j] == T[k] ? LCP1[i][j + 1][k + 1] + 1 : 0);
      for (int j = 1; j <= n; j++)
        LCP2[i][j][k] = (S[i][j] == T[k] ? LCP2[i][j - 1][k + 1] + 1 : 0);
    }
    for (int k = 1; k <= m; k++) {
      for (int j = n; j >= 1; j--)
        LCS1[i][j][k] = (S[i][j] == T[k] ? LCS1[i][j + 1][k - 1] + 1 : 0);
      for (int j = 1; j <= n; j++)
        LCS2[i][j][k] = (S[i][j] == T[k] ? LCS2[i][j - 1][k - 1] + 1 : 0);
    }
  }
  for (int i = 0; i <= 1; i++)
    for (int j = 1; j <= n; j++) {
      for (int k = 2; k <= min(n - j + 1, m / 2); k++)
        U1[i][j][k] = LCS1[i ^ 1][j][m] >= k && LCS2[i][j + k - 1][m - k] >= k;
      for (int k = 2; k <= min(j, m / 2); k++)
        U2[i][j][k] = LCP2[i ^ 1][j][1] >= k && LCP1[i][j - k + 1][k + 1] >= k;
    }
  if (!(m & 1))
    for (int i = 1; i <= n; i++) {
      ans += U1[1][i][m / 2] + U2[1][i][m / 2];
      for (int j = 0; j <= 1; j++)
        for (int k = 2; k <= m / 2 - 2; k++)
          ans += U2[j][i][k] && U1[j][i + 1][m / 2 - k];
    }
  for (int i = 1; i <= n; i++) {
    for (int j = 0; j <= 1; j++) {
      if (S[j][i] == T[1]) F[j][i][1]++;
      for (int k = 2; k <= m / 2; k++)
        if (U2[j][i - 1][k] && S[j][i] == T[k + k + 1]) F[j][i][k + k + 1]++;
      for (int k = 1; k <= m; k++)
        if (S[j][i] == T[k + 1])
          F[j][i][k + 1] = (F[j][i - 1][k] + F[j][i][k + 1]) % Mod,
                      F[j][i][k + 1] = (F[j][i][k + 1] + G[j][i - 1][k]) % Mod;
      for (int k = 1; k <= m; k++)
        if (S[j ^ 1][i] == T[k + 1])
          G[j ^ 1][i][k + 1] = (G[j ^ 1][i][k + 1] + F[j][i][k]) % Mod;
    }
    for (int j = 0; j <= 1; j++) {
      ans = (1ll * ans + F[j][i][m] + G[j][i][m]) % Mod;
      for (int k = 2; k <= m / 2; k++)
        if (U1[j][i + 1][k])
          ans = (1ll * ans + F[j][i][m - k - k] + G[j][i][m - k - k]) % Mod;
    }
  }
}
int main() {
  scanf("%s%s%s", S[0] + 1, S[1] + 1, T + 1);
  n = strlen(S[0] + 1), m = strlen(T + 1);
  if (m == 1) {
    for (int i = 0; i <= 1; i++)
      for (int j = 1; j <= n; j++) ans += S[i][j] == T[1];
    cout << ans << "\n";
    return 0;
  }
  if (m == 2) {
    for (int i = 0; i <= 1; i++)
      for (int j = 1; j <= n; j++)
        if (S[i][j] == T[1])
          ans += (S[i ^ 1][j] == T[2]) + (S[i][j - 1] == T[2]) +
                 (S[i][j + 1] == T[2]);
    cout << ans << "\n";
    return 0;
  }
  Solve(), reverse(T + 1, T + m + 1), memset(F, 0, sizeof(F)),
      memset(G, 0, sizeof(G)), Solve(), cout << ans << '\n';
  return 0;
}