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
#include <bits/stdc++.h>
using namespace std;
const int mo = 1000000007;
const int N = 2005;
char s[2][N], t[N];
int n, m, ans;
int lcs[2][N][N];
int lcp[2][N][N];
int f[N][N][2];
void UPD(int &x, int y) { (x += y) >= mo ? x -= mo : 233; }
void solve(bool type) {
  for (int k = (int)(0); k <= (int)(1); k++)
    for (int i = (int)(n); i >= (int)(1); i--)
      for (int j = (int)(m); j >= (int)(1); j--)
        lcp[k][i][j] = (s[k][i] == t[j] ? lcp[k][i + 1][j + 1] + 1 : 0);
  reverse(t + 1, t + m + 1);
  for (int k = (int)(0); k <= (int)(1); k++)
    for (int i = (int)(n); i >= (int)(1); i--)
      for (int j = (int)(m); j >= (int)(1); j--)
        lcs[k][i][j] = (s[k][i] == t[j] ? lcs[k][i + 1][j + 1] + 1 : 0);
  reverse(t + 1, t + m + 1);
  memset(f, 0, sizeof(f));
  for (int i = (int)(1); i <= (int)(n + 1); i++) {
    for (int k = (int)(0); k <= (int)(1); k++) f[i][1][k] = 1;
    for (int j = (int)(2); j <= (int)(i - 1); j++)
      for (int k = (int)(0); k <= (int)(1); k++)
        if (type || j * 2 < m)
          if (lcp[k][i - j][j + 1] >= j && lcs[k ^ 1][i - j][m - j + 1] >= j)
            UPD(f[i][2 * j + 1][k], 1);
    for (int j = (int)(1); j <= (int)(m); j++)
      for (int k = (int)(0); k <= (int)(1); k++)
        if (i <= n && s[k][i] == t[j] && f[i][j][k]) {
          UPD(f[i + 1][j + 1][k], f[i][j][k]);
          if (j + 1 <= m && s[k ^ 1][i] == t[j + 1])
            UPD(f[i + 1][j + 2][k ^ 1], f[i][j][k]);
          if ((m - j + 1) > 2 && (m - j + 1) % 2 == 0 && (type || j != 1)) {
            int l = (m - j + 1) / 2;
            if (lcp[k][i][j] >= l && lcs[k ^ 1][i][1] >= l)
              UPD(ans, f[i][j][k]);
          }
        }
    UPD(ans, f[i][m + 1][0]);
    UPD(ans, f[i][m + 1][1]);
  }
}
int main() {
  scanf("%s", s[0] + 1);
  scanf("%s", s[1] + 1);
  scanf("%s", t + 1);
  n = strlen(s[0] + 1);
  m = strlen(t + 1);
  solve(1);
  if (m >= 2) {
    reverse(t + 1, t + m + 1);
    solve(0);
  }
  if (m == 2) {
    for (int i = (int)(1); i <= (int)(n); i++) {
      if (s[0][i] == t[1] && s[1][i] == t[2]) UPD(ans, mo - 1);
      if (s[0][i] == t[2] && s[1][i] == t[1]) UPD(ans, mo - 1);
    }
  }
  printf("%d\n", ans);
}
