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>
const int N = 2e3 + 10, P = 1e9 + 7;
const long long se = 31;
const long long mod = 987654321;
int ri() {
  char c = getchar();
  int x = 0, f = 1;
  for (; c < '0' || c > '9'; c = getchar())
    if (c == '-') f = -1;
  for (; c >= '0' && c <= '9'; c = getchar()) x = (x << 1) + (x << 3) - '0' + c;
  return x * f;
}
long long pw[N];
struct Hash {
  long long h[N];
  void Build(int n, char *s) {
    h[0] = 0;
    for (int i = 1; i <= n; ++i) h[i] = (h[i - 1] * se + s[i] - 'a') % mod;
  }
  long long Sub(int l, int r) {
    return (h[r] + mod - h[l - 1] * pw[r - l + 1] % mod) % mod;
  }
} pre[2], suf[2], t;
char a[2][N], s[N];
int f[2][N][N], n, m;
void Up(int &a, int b) {
  a += b;
  if (a >= P) a -= P;
}
int Solve(bool p) {
  long long ret = 0;
  memset(f, 0, sizeof(f));
  for (int j = 1; j <= n; ++j) {
    f[0][j][0] = f[1][j][0] = 1;
    for (int i = 0; i < 2; ++i)
      for (int k = 2; k <= std::min(n - j + 1, m >> 1); ++k)
        if (p || k << 1 != m)
          if (t.Sub(m - (k << 1) + 1, m - k) == pre[i].Sub(j, j + k - 1) &&
              t.Sub(m - k + 1, m) ==
                  suf[i ^ 1].Sub(n - (j + k - 1) + 1, n - j + 1))
            ret += f[i][j][m - (k << 1)];
    for (int i = 0; i < 2; ++i)
      for (int k = 2; k <= std::min(j, m >> 1); ++k)
        if (p || k << 1 != m)
          if (t.Sub(k + 1, k << 1) == pre[i].Sub(j - k + 1, j) &&
              t.Sub(1, k) == suf[i ^ 1].Sub(n - j + 1, n - (j - k + 1) + 1))
            Up(f[i][j + 1][k << 1], 1);
    for (int i = 0; i < 2; ++i)
      for (int k = 0; k < m; ++k)
        if (a[i][j] == s[k + 1]) {
          Up(f[i][j + 1][k + 1], f[i][j][k]);
          if (k + 2 <= m && a[i ^ 1][j] == s[k + 2])
            Up(f[i ^ 1][j + 1][k + 2], f[i][j][k]);
        }
    for (int i = 0; i < 2; ++i) ret += f[i][j + 1][m];
  }
  return ret % P;
}
int main() {
  scanf("%s", a[0] + 1);
  scanf("%s", a[1] + 1);
  scanf("%s", s + 1);
  n = strlen(a[0] + 1);
  m = strlen(s + 1);
  pw[0] = 1;
  for (int i = 1; i <= std::max(n, m); ++i) pw[i] = pw[i - 1] * se % mod;
  for (int i = 0; i < 2; ++i) {
    pre[i].Build(n, a[i]);
    std::reverse(a[i] + 1, a[i] + n + 1);
    suf[i].Build(n, a[i]);
    std::reverse(a[i] + 1, a[i] + n + 1);
  }
  t.Build(m, s);
  int ans = Solve(1);
  if (m > 1) {
    std::reverse(s + 1, s + m + 1);
    t.Build(m, s);
    ans += Solve(0);
    if (m == 2)
      for (int j = 1; j <= n; ++j)
        for (int i = 0; i < 2; ++i)
          if (a[i][j] == s[1] && a[i ^ 1][j] == s[2]) --ans;
  }
  printf("%d\n", (ans % P + P) % P);
  return 0;
}