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>
const int MOD = 1e9 + 7;
const int MAXN = 2000 + 1;
inline void add(int &x, const int v) {
  x = (x + v >= MOD ? x + v - MOD : x + v);
}
inline void dec(int &x, const int v) { x = (x - v < 0 ? x - v + MOD : x - v); }
int n, m;
char a[2][MAXN], w[MAXN];
int c[2][MAXN][MAXN], cr[2][MAXN][MAXN];
template <size_t size>
inline void calc(int u, int c[size][size]) {
  for (int i = n - 1; i >= 0; i--)
    for (int j = m - 1; j >= 0; j--)
      c[i][j] = a[u][i] == w[j] ? 1 + c[i + 1][j + 1] : 0;
}
int d[2][MAXN][MAXN];
inline int solve(bool flag) {
  int ans = 0;
  memset(d, 0, sizeof(d));
  for (int i = 0; i < n; i++) {
    d[0][i][0] = d[1][i][0] = 1;
    for (int u = 0; u < 2; u++)
      for (int j = 2; j < std::min(n - i, m / 2) + 1; j++)
        if (c[u][i][m - 2 * j] >= j && cr[u ^ 1][i][0] >= j &&
            (2 * j < m || flag))
          add(ans, d[u][i][m - 2 * j]);
    for (int u = 0; u < 2; u++) {
      for (int j = 0; j < m; j++) {
        if (a[u][i] == w[j]) {
          add(d[u][i + 1][j + 1], d[u][i][j]);
          if (j + 1 < m && a[u ^ 1][i] == w[j + 1])
            add(d[u ^ 1][i + 1][j + 2], d[u][i][j]);
        }
      }
    }
    for (int u = 0, l; u < 2; u++) {
      for (int j = 2; j < std::min(i + 1, m / 2) + 1; ++j) {
        l = i - j + 1;
        if (c[u][l][j] >= j && cr[u ^ 1][l][m - j] >= j && (2 * j < m || flag))
          add(d[u][i + 1][2 * j], 1);
      }
    }
    for (int u = 0; u < 2; u++) add(ans, d[u][i + 1][m]);
  }
  return ans;
}
int main() {
  std::cin >> a[0] >> a[1] >> w;
  n = strlen(a[0]);
  m = strlen(w);
  for (int i = 0; i < 2; i++) calc(i, cr[i]);
  std::reverse(w, w + m);
  for (int i = 0; i < 2; i++) calc(i, c[i]);
  int ans = solve(true);
  if (m > 1) {
    std::reverse(w, w + m);
    for (int u = 0; u < 2; u++)
      for (int i = 0; i < n; i++)
        std::swap_ranges(c[u][i], c[u][i] + m, cr[u][i]);
    add(ans, solve(false));
    if (m == 2)
      for (int i = 0; i < n; i++)
        for (int u = 0; u < 2; u++)
          if (a[u][i] == w[0] && a[u ^ 1][i] == w[1]) dec(ans, 1);
  }
  std::cout << ans;
  return 0;
}
