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;
char s[2][4003], t[4003];
int n, K;
long long hs[2][2][4003], pw[4003], hst[4003];
int f[2][2][4003];
template <class T, class T2>
void add(T &u, T2 v) {
  ((u += v) >= 1000000007) && (u -= 1000000007);
}
long long ans = 0;
void Solve() {
  int now = 1, pre = 0;
  memset(f, 0, sizeof f);
  for (int i = (1), LIM = (n); i <= LIM; i++) {
    swap(now, pre);
    memset(f[now], 0, sizeof f[now]);
    for (int j = (0), LIM = (1); j <= LIM; j++) {
      if (s[j][i] == t[1]) f[now][j][1]++;
      for (int k = (1), LIM = (min(i, K / 2)); k <= LIM; k++)
        if ((((hs[j ^ 1][1][i - k + 1] - hs[j ^ 1][1][i + 1] * pw[k]) %
                  998244353 * pw[k] +
              (hs[j][0][i] - hs[j][0][i - k] * pw[k])) %
                 998244353 +
             998244353) %
                998244353 ==
            hst[2 * k]) {
          f[now][j][2 * k]++;
        }
      for (int k = (2), LIM = (K); k <= LIM; k++) {
        if (s[j][i] == t[k]) add(f[now][j][k], f[pre][j][k - 1]);
        if (s[j][i] == t[k] && s[j ^ 1][i] == t[k - 1])
          add(f[now][j][k], f[pre][j ^ 1][k - 2]);
      }
      for (int k = (2), LIM = (min(K / 2, n - i)); k <= LIM; k++)
        if ((((hs[j][0][i + k] - hs[j][0][i] * pw[k]) % 998244353 * pw[k] +
              (hs[j ^ 1][1][i + 1] - hs[j ^ 1][1][i + k + 1] * pw[k])) %
                 998244353 +
             998244353) %
                998244353 ==
            ((hst[K] - hst[K - 2 * k] * pw[2 * k]) % 998244353 + 998244353) %
                998244353) {
          add(ans, f[now][j][K - 2 * k]);
        }
      add(ans, f[now][j][K]);
    }
  }
}
int main() {
  scanf("%s%s%s", s[0] + 1, s[1] + 1, t + 1);
  n = strlen(s[0] + 1);
  K = strlen(t + 1);
  pw[0] = 1;
  for (int i = (1), LIM = (2 * max(n, K)); i <= LIM; i++)
    pw[i] = 131 * pw[i - 1] % 998244353;
  for (int t = (0), LIM = (1); t <= LIM; t++)
    for (int i = (1), LIM = (n); i <= LIM; i++)
      hs[t][0][i] = (hs[t][0][i - 1] * 131 + s[t][i]) % 998244353;
  for (int t = (0), LIM = (1); t <= LIM; t++)
    for (int i = (n), LIM = (1); i >= LIM; i--)
      hs[t][1][i] = (hs[t][1][i + 1] * 131 + s[t][i]) % 998244353;
  for (int i = (1), LIM = (K); i <= LIM; i++)
    hst[i] = (hst[i - 1] * 131 + t[i]) % 998244353;
  Solve();
  reverse(s[0] + 1, s[0] + n + 1);
  reverse(s[1] + 1, s[1] + n + 1);
  for (int t = (0), LIM = (1); t <= LIM; t++)
    for (int i = (1), LIM = (n); i <= LIM; i++)
      hs[t][0][i] = (hs[t][0][i - 1] * 131 + s[t][i]) % 998244353;
  for (int t = (0), LIM = (1); t <= LIM; t++)
    for (int i = (n), LIM = (1); i >= LIM; i--)
      hs[t][1][i] = (hs[t][1][i + 1] * 131 + s[t][i]) % 998244353;
  Solve();
  if (K == 1) ans /= 2;
  if (K == 2) {
    for (int i = (1), LIM = (n); i <= LIM; i++) {
      if (s[0][i] == t[1] && s[1][i] == t[2]) ans--;
      if (s[0][i] == t[2] && s[1][i] == t[1]) ans--;
    }
  }
  printf("%lld\n", ans);
}
