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 int mod = 1e9 + 7;
void Inc(int &x, int y) { x += y, x -= x >= mod ? mod : 0; }
void Dec(int &x, int y) { x -= y, x += x < 0 ? mod : 0; }
int inc(int x, int y) { return x + y >= mod ? x + y - mod : x + y; }
int dec(int x, int y) { return x < y ? x - y + mod : x - y; }
int mul(int x, int y) { return 1LL * x * y % mod; }
const int maxn = 2e3 + 3;
const int base = 131;
int n, m, pw[maxn], val[2][maxn];
int pre[maxn], suf[maxn], f[2][maxn][maxn], ans;
char s[2][maxn], t[maxn];
int cal(int *hh, int l, int r) {
  return dec(hh[r], mul(hh[l - 1], pw[r - l + 1]));
}
bool check_1(int i, int j, int k) {
  if (k & 1) return false;
  if (j < (k >>= 1)) return false;
  if (cal(val[i], j - k + 1, j) != cal(suf, m - k + 1, m)) return false;
  if (cal(val[i ^ 1], j - k + 1, j) != cal(pre, k + 1, k + k)) return false;
  return true;
}
bool check_2(int i, int j, int k) {
  if (k & 1) return false;
  if (j + (k >>= 1) > n + 1) return false;
  if (cal(val[i ^ 1], j, j + k - 1) != cal(pre, m - k - k + 1, m - k))
    return false;
  if (cal(val[i], j, j + k - 1) != cal(suf, 1, k)) return false;
  return true;
}
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 (check_1(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) {
            if (m - k == 1 && s[i][j + 1] == t[m]) Inc(ans, f[i][j][k]);
            if (check_2(i ^ 1, j + 1, m - k)) Inc(ans, f[i][j][k]);
          }
        }
      }
    }
  }
}
int main() {
  for (int i = pw[0] = 1; i < maxn; i++) pw[i] = mul(pw[i - 1], base);
  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++) ans += (s[i][j] == t[1]);
  } else {
    for (int i = 0; i < 2; i++)
      for (int j = 1; j <= n; j++)
        val[i][j] = inc(mul(val[i][j - 1], base), s[i][j]);
    for (int i = 1; i <= m; i++) pre[i] = inc(mul(pre[i - 1], base), t[i]);
    for (int i = 1; i <= m; i++)
      suf[i] = inc(mul(suf[i - 1], base), t[m - i + 1]);
    solve(), reverse(t + 1, t + m + 1);
    for (int i = 1; i <= m; i++) pre[i] = inc(mul(pre[i - 1], base), t[i]);
    for (int i = 1; i <= m; i++)
      suf[i] = inc(mul(suf[i - 1], base), t[m - i + 1]);
    solve();
    for (int i = 0; i < 2; i++) {
      for (int j = 1; j <= n; j++) {
        if (check_1(i, j, m)) Inc(ans, 1);
        if (m > 2 && check_2(i, j, m)) Inc(ans, 1);
      }
    }
  }
  printf("%d\n", ans);
  return 0;
}