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 N = 2005;
const long long base = 233;
const long long mod = 998244353;
template <typename T>
inline void read(T &AKNOI) {
  T x = 0, flag = 1;
  char ch = getchar();
  while (!isdigit(ch)) {
    if (ch == '-') flag = 1;
    ch = getchar();
  }
  while (isdigit(ch)) {
    x = x * 10 + ch - '0';
    ch = getchar();
  }
  AKNOI = flag * x;
}
namespace ModCalculator {
const int MOD = 1e9 + 7;
inline void Inc(int &x, int y) {
  x += y;
  if (x >= MOD) x -= MOD;
}
inline void Dec(int &x, int y) {
  x -= y;
  if (x < 0) x += MOD;
}
inline int Add(int x, int y) {
  Inc(x, y);
  return x;
}
inline int Sub(int x, int y) {
  Dec(x, y);
  return x;
}
inline int Mul(int x, int y) { return 1LL * x * y % MOD; }
inline int Ksm(int x, int y) {
  int ret = 1;
  for (; y; y >>= 1) {
    if (y & 1) ret = Mul(ret, x);
    x = Mul(x, x);
  }
  return ret;
}
inline int Inv(int x) { return Ksm(x, MOD - 2); }
}  // namespace ModCalculator
using namespace ModCalculator;
char s[2][N], t[N];
int n, m, ans, dp[2][N][N];
long long pw[N];
struct HashTable {
  long long hs[N];
  inline void Build(int nn, char *ss) {
    for (int i = 1; i <= nn; ++i) {
      hs[i] = (hs[i - 1] * base + ss[i]) % mod;
    }
  }
  inline long long Hash(int l, int r) {
    return (hs[r] - hs[l - 1] * pw[r - l + 1] % mod + mod) % mod;
  }
} HT, H0[2], H1[2];
void Calc() {
  for (int i = 1; i <= n; ++i) {
    for (int j = 0; j < 2; ++j) {
      int l = j ^ 1;
      if (s[j][i] == t[1]) {
        Inc(dp[j][i][1], 1);
      }
      for (int k = 1, rk = min(i, m / 2); k <= rk; ++k) {
        if (H1[l].Hash(n - i + 1, n - i + k) == HT.Hash(1, k) &&
            H0[j].Hash(i - k + 1, i) == HT.Hash(k + 1, k * 2)) {
          Inc(dp[j][i][k * 2], 1);
        }
      }
      for (int k = 2; k <= m; ++k) {
        if (s[j][i] == t[k]) {
          Inc(dp[j][i][k], dp[j][i - 1][k - 1]);
        }
        if (k > 2 && s[j][i] == t[k] && s[l][i] == t[k - 1]) {
          Inc(dp[j][i][k], dp[l][i - 1][k - 2]);
        }
      }
      Inc(ans, dp[j][i][m]);
      for (int k = 2, rk = min(n - i, m / 2); k <= rk; ++k) {
        if (H0[j].Hash(i + 1, i + k) == HT.Hash(m - k * 2 + 1, m - k) &&
            H1[l].Hash(n - i - k + 1, n - i) == HT.Hash(m - k + 1, m)) {
          Inc(ans, dp[j][i][m - k * 2]);
        }
      }
    }
  }
}
void init() {
  scanf("%s", s[0] + 1);
  scanf("%s", s[1] + 1);
  scanf("%s", t + 1);
  n = strlen(s[0] + 1);
  m = strlen(t + 1);
  pw[0] = 1;
  for (int i = 1; i <= n; ++i) {
    pw[i] = pw[i - 1] * base % mod;
  }
}
void solve() {
  if (m == 1) {
    for (int i = 1; i <= n; ++i) {
      for (int j = 0; j < 2; ++j) {
        ans += (s[j][i] == t[1]);
      }
    }
    printf("%d\n", ans);
    return;
  }
  if (m == 2) {
    for (int i = 1; i <= n; ++i) {
      for (int j = 0; j < 2; ++j) {
        if (s[j][i] != t[1]) continue;
        if (i > 1) ans += (s[j][i - 1] == t[2]);
        if (i < n) ans += (s[j][i + 1] == t[2]);
        if (j > 0) ans += (s[j - 1][i] == t[2]);
        if (j < 1) ans += (s[j + 1][i] == t[2]);
      }
    }
    printf("%d\n", ans);
    return;
  }
  HT.Build(m, t);
  H0[0].Build(n, s[0]);
  H0[1].Build(n, s[1]);
  reverse(s[0] + 1, s[0] + n + 1);
  reverse(s[1] + 1, s[1] + n + 1);
  H1[0].Build(n, s[0]);
  H1[1].Build(n, s[1]);
  reverse(s[0] + 1, s[0] + n + 1);
  reverse(s[1] + 1, s[1] + n + 1);
  Calc();
  swap(H0[0], H1[0]);
  swap(H0[1], H1[1]);
  reverse(s[0] + 1, s[0] + n + 1);
  reverse(s[1] + 1, s[1] + n + 1);
  memset(dp, 0, sizeof(dp));
  Calc();
  printf("%d\n", ans);
}
int main() {
  init();
  solve();
  return 0;
}