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;
bool debug = 0;
int n, m, k;
int dx[4] = {0, 1, 0, -1}, dy[4] = {1, 0, -1, 0};
string direc = "RDLU";
long long ln, lk, lm;
char s[2][2005], t[2005];
void add(int &x, int y) {
  x += y;
  if (x >= 1000000007) x -= 1000000007;
}
int dp[2][2005][2005];
int lcp[2][2005][2005], lcs[2][2005][2005];
int cal(bool fg) {
  for (int(k) = 0; (k) < (int)(2); (k)++) {
    for (int i = n; i; i--) {
      for (int j = m; j; j--) {
        lcp[k][i][j] = s[k][i] == t[j] ? lcp[k][i + 1][j + 1] + 1 : 0;
      }
    }
  }
  reverse(t + 1, t + 1 + m);
  for (int(k) = 0; (k) < (int)(2); (k)++) {
    for (int i = n; i; i--) {
      for (int j = m; j; j--) {
        lcs[k][i][j] = s[k][i] == t[j] ? lcs[k][i + 1][j + 1] + 1 : 0;
      }
    }
  }
  reverse(t + 1, t + 1 + m);
  int res = 0;
  memset(dp, 0, sizeof dp);
  for (int(j) = 1; (j) <= (int)(n); (j)++) {
    dp[0][j][0] = 1;
    dp[1][j][0] = 1;
    for (int(i) = 0; (i) < (int)(2); (i)++) {
      for (int k = 2; k + k <= m && j + k <= n + 1; k++) {
        if (lcp[i][j][m - k - k + 1] >= k && lcs[i ^ 1][j][1] >= k) {
          if (fg || k + k < m) add(res, dp[i][j][m - k - k]);
        }
      }
    }
    for (int(i) = 0; (i) < (int)(2); (i)++) {
      for (int k = 2; k + k <= m && j - k >= 0; k++) {
        if (lcs[i][j - k + 1][m - k + 1] >= k &&
            lcp[i ^ 1][j - k + 1][k + 1] >= k) {
          if (fg || k + k < m) add(dp[i ^ 1][j + 1][k + k], 1);
        }
      }
    }
    for (int(i) = 0; (i) < (int)(2); (i)++) {
      for (int k = 1; k <= m; k++) {
        if (t[k] == s[i][j]) {
          add(dp[i][j + 1][k], dp[i][j][k - 1]);
          if (t[k + 1] == s[i ^ 1][j]) {
            add(dp[i ^ 1][j + 1][k + 1], dp[i][j][k - 1]);
          }
        }
      }
    }
    for (int(i) = 0; (i) < (int)(2); (i)++) add(res, dp[i][j + 1][m]);
  }
  return res;
}
void fmain() {
  scanf("%s%s", s[0] + 1, s[1] + 1);
  scanf("%s", t + 1);
  n = strlen(s[0] + 1);
  m = strlen(t + 1);
  int ans = 0;
  add(ans, cal(1));
  if (m > 1) {
    reverse(t + 1, t + m + 1);
    add(ans, cal(0));
  }
  if (m == 2) {
    for (int(j) = 1; (j) <= (int)(n); (j)++)
      for (int(i) = 0; (i) < (int)(2); (i)++) {
        if (s[i][j] == t[1] && s[i ^ 1][j] == t[2]) add(ans, 1000000007 - 1);
      }
  }
  printf("%d\n", ans);
}
int main() {
  fmain();
  return 0;
}
