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;
int IN() {
  int c, f, x;
  while (!isdigit(c = getchar()) && c != '-')
    ;
  c == '-' ? (f = 1, x = 0) : (f = 0, x = c - '0');
  while (isdigit(c = getchar())) x = (x << 1) + (x << 3) + c - '0';
  return !f ? x : -x;
}
const int N = 2000 + 19;
const int p = 1e9 + 7;
char t[2][N], s[N];
int pre[2][N][N], suf[2][N][N];
int lcp[2][N][N], lcs[2][N][N];
int n, m, ans;
void Init() {
  for (int i = 0; i < 2; i++) {
    for (int j = n; j >= 1; j--)
      for (int k = m; k >= 1; k--)
        lcp[i][j][k] = (t[i][j] == s[k] ? lcp[i][j + 1][k + 1] + 1 : 0);
    for (int j = 1; j <= n; j++)
      for (int k = m; k >= 1; k--)
        lcs[i][j][k] = (t[i][j] == s[k] ? lcs[i][j - 1][k + 1] + 1 : 0);
  }
}
void U(int &x, int y) { x = (x + y) % p; }
void Dp() {
  for (int j = 1; j <= n; j++)
    for (int k = 1; k <= m; k++)
      for (int i = 0; i < 2; i++) {
        if (t[i][j] != s[k]) continue;
        if (k == m) {
          pre[i][j][k] = 1;
          continue;
        }
        U(pre[i][j][k], pre[i][j - 1][k + 1]);
        if ((m - k + 1) % 2 == 0) {
          int len = (m - k + 1) / 2;
          if (len <= j && lcs[i][j][k] >= len &&
              lcp[i ^ 1][j - len + 1][k + len] >= len)
            U(pre[i][j][k], 1);
        }
        if (t[i ^ 1][j] == s[k + 1] && k + 2 <= m)
          U(pre[i][j][k], pre[i ^ 1][j - 1][k + 2]);
      }
  for (int j = n; j >= 1; j--)
    for (int k = 1; k <= m; k++)
      for (int i = 0; i < 2; i++) {
        if (t[i][j] != s[k]) continue;
        if (k == m) {
          suf[i][j][k] = 1;
          continue;
        }
        U(suf[i][j][k], suf[i][j + 1][k + 1]);
        if ((m - k + 1) % 2 == 0) {
          int len = (m - k + 1) / 2;
          if (len <= n - j + 1 && lcp[i][j][k] >= len &&
              lcs[i ^ 1][j + len - 1][k + len] >= len)
            U(suf[i][j][k], 1);
        }
        if (t[i ^ 1][j] == s[k + 1] && k + 2 <= m)
          U(suf[i][j][k], suf[i ^ 1][j + 1][k + 2]);
      }
}
void Work() {
  for (int i = 0; i < 2; i++)
    for (int j = 1; j <= n; j++) {
      for (int k = 1; k < j; k++) {
        if (lcs[i][j][1] < j - k + 1) continue;
        if (j - k + 1 == m) {
          U(ans, 1);
          continue;
        }
        if (t[i ^ 1][k] != s[j - k + 2]) continue;
        if (j - k + 2 == m) {
          U(ans, 1);
          continue;
        }
        U(ans, pre[i ^ 1][k - 1][j - k + 3]);
        int tmp = lcp[i ^ 1][k][j - k + 2];
        if (tmp <= j - k + 1) {
          if (tmp >= m - (j - k + 1)) U(ans, 1);
        } else {
          U(ans, suf[i ^ 1][j + 1][(j - k + 1) * 2 + 1]);
        }
      }
      for (int k = j; k <= n; k++) {
        if (lcp[i][j][1] < k - j + 1) continue;
        if (k - j + 1 == m) {
          U(ans, 1);
          continue;
        }
        if (t[i ^ 1][k] != s[k - j + 2]) continue;
        if (k - j + 2 == m) {
          U(ans, 1);
          continue;
        }
        U(ans, suf[i ^ 1][k + 1][k - j + 3]);
        int tmp = lcs[i ^ 1][k][k - j + 2];
        if (tmp <= k - j + 1) {
          if (tmp >= m - (k - j + 1)) U(ans, 1);
        } else {
          U(ans, pre[i ^ 1][j - 1][(k - j + 1) * 2 + 1]);
        }
      }
    }
}
int main() {
  scanf("%s%s", t[0] + 1, t[1] + 1);
  n = strlen(t[0] + 1);
  scanf("%s", s + 1);
  m = strlen(s + 1);
  Init();
  Dp();
  Work();
  printf("%d\n", ans);
}