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;
const int N = 2005;
const int mod = 1e9 + 7;
const int base = 131;
int n, m, pw[N], val[2][N], pre[N], suf[N], f[2][N][N], ans;
char s[2][N], t[N];
void Inc(int &x, int y) {
  x += y;
  x >= mod ? x -= mod : x;
}
int cal(int *hsh, int l, int r) {
  return (hsh[r] + 1ll * hsh[l - 1] * (mod - pw[r - l + 1])) % mod;
}
bool check1(int i, int j, int k) {
  if (k & 1) return false;
  k >>= 1;
  if (j < k) return false;
  return cal(val[i], j - k + 1, j) == cal(suf, m - k + 1, m) &&
         cal(val[i ^ 1], j - k + 1, j) == cal(pre, k + 1, k + k);
}
bool check2(int i, int j, int k) {
  if (k & 1) return false;
  k >>= 1;
  if (j + k > n + 1) return false;
  return cal(val[i ^ 1], j, j + k - 1) == cal(pre, m - k - k + 1, m - k) &&
         cal(val[i], j, j + k - 1) == cal(suf, 1, k);
}
void solve() {
  memset(f, 0, sizeof(f));
  for (int j = 1; j <= n; ++j)
    for (int i = 0; i < 2; ++i)
      for (int k = 1; k <= m; ++k)
        if (s[i][j] == t[k]) {
          if (k == 1) Inc(f[i][j][k], 1);
          if (check1(i ^ 1, j, k)) Inc(f[i][j][k], 1);
          Inc(f[i][j][k], f[i][j - 1][k - 1]);
          if (k > 1 && s[i ^ 1][j] == t[k - 1])
            Inc(f[i][j][k], f[i ^ 1][j - 1][k - 2]);
          if (j < n && k < m) {
            int kk = m - k;
            if (kk == 1 && s[i][j + 1] == t[m]) Inc(ans, f[i][j][k]);
            if (check2(i ^ 1, j + 1, kk)) Inc(ans, f[i][j][k]);
          }
        }
}
int main() {
  for (int i = pw[0] = 1; i < N; ++i) pw[i] = 1ll * pw[i - 1] * base % mod;
  scanf("%s%s%s", s[0] + 1, s[1] + 1, t + 1);
  n = strlen(s[0] + 1);
  m = strlen(t + 1);
  if (m == 1) {
    for (int i = 0; i < 2; ++i)
      for (int j = 1; j <= n; ++j)
        if (s[i][j] == t[1]) ++ans;
  } else {
    for (int i = 0; i < 2; ++i)
      for (int j = 1; j <= n; ++j)
        val[i][j] = (1ll * val[i][j - 1] * base + s[i][j]) % mod;
    for (int i = 1; i <= m; ++i) {
      pre[i] = (1ll * pre[i - 1] * base + t[i]) % mod;
      suf[i] = (1ll * suf[i - 1] * base + t[m - i + 1]) % mod;
    }
    solve();
    reverse(t + 1, t + m + 1);
    for (int i = 1; i <= m; ++i) {
      pre[i] = (1ll * pre[i - 1] * base + t[i]) % mod;
      suf[i] = (1ll * suf[i - 1] * base + t[m - i + 1]) % mod;
    }
    solve();
    for (int i = 0; i < 2; ++i)
      for (int j = 1; j <= n; ++j) {
        if (check1(i, j, m)) Inc(ans, 1);
        if (m > 2 && check2(i, j, m)) Inc(ans, 1);
      }
  }
  printf("%d\n", ans);
  return 0;
}
