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 long long seed = 233;
const long long mod = 998244353;
const long long P = 1e9 + 7;
char s[2][2010], w[2010];
int n, m;
int dp[2][2010][2010], ans;
long long Pow[2010];
struct node {
  long long h[2010];
  void make(int n, char* s) {
    for (int i = 1; i <= n; i++) {
      h[i] = h[i - 1] * seed + s[i] - 'a';
      h[i] %= mod;
    }
  }
  long long cut(int l, int r) {
    return (h[r] - h[l - 1] * Pow[r - l + 1] % mod + mod) % mod;
  }
} pre[2], suf[2], ss;
void add(int& x, int y) {
  x += y;
  if (x > P) x -= P;
}
int solve(bool first) {
  int ret = 0;
  memset(dp, 0, sizeof(dp));
  for (int j = 1; j <= n; j++) {
    dp[0][j][0] = dp[1][j][0] = 1;
    for (int i = 0; i < 2; i++)
      for (int k = 2; k <= min(n - j + 1, m / 2); k++)
        if (ss.cut(m - 2 * k + 1, m - k) == pre[i].cut(j, j + k - 1) &&
            ss.cut(m - k + 1, m) ==
                suf[i ^ 1].cut(n - (j + k - 1) + 1, n - j + 1))
          if (2 * k != m || first) add(ret, dp[i][j][m - 2 * k]);
    for (int i = 0; i < 2; i++)
      for (int k = 2; k <= min(j, m / 2); k++)
        if (ss.cut(k + 1, 2 * k) == pre[i].cut(j - k + 1, j) &&
            ss.cut(1, k) == suf[i ^ 1].cut(n - j + 1, n - (j - k + 1) + 1))
          if (2 * k != m || first) add(dp[i][j + 1][2 * k], 1);
    for (int i = 0; i < 2; i++)
      for (int k = 0; k < m; k++)
        if (s[i][j] == w[k + 1]) {
          add(dp[i][j + 1][k + 1], dp[i][j][k]);
          if (k + 2 <= m && s[i ^ 1][j] == w[k + 2])
            add(dp[i ^ 1][j + 1][k + 2], dp[i][j][k]);
        }
    for (int i = 0; i < 2; i++) add(ret, dp[i][j + 1][m]);
  }
  return ret;
}
int main() {
  Pow[0] = 1;
  for (int i = 1; i <= 2000; i++) Pow[i] = Pow[i - 1] * seed % mod;
  scanf("%s", s[0] + 1);
  scanf("%s", s[1] + 1);
  n = strlen(s[0] + 1);
  for (int i = 0; i < 2; i++) {
    pre[i].make(n, s[i]);
    reverse(s[i] + 1, s[i] + n + 1);
    suf[i].make(n, s[i]);
    reverse(s[i] + 1, s[i] + n + 1);
  }
  scanf("%s", w + 1);
  m = strlen(w + 1);
  ss.make(m, w);
  add(ans, solve(1));
  if (m > 1) {
    reverse(w + 1, w + m + 1);
    ss.make(m, w);
    add(ans, solve(0));
    if (m == 2) {
      for (int j = 1; j <= n; j++)
        for (int i = 0; i < 2; i++)
          if (s[i][j] == w[1] && s[i ^ 1][j] == w[2]) add(ans, P - 1);
    }
  }
  printf("%d\n", ans);
  return 0;
}