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 long long N = 2005, mod = 1e9 + 7, base = 233, inv2 = (mod + 1) / 2;
long long pre[2][N], suf[2][N], Hash[N], pw[N];
long long f[2][N][N], g[2][N][N], ans, cnt;
long long n, m;
char s[2][N], t[N];
long long hpre(long long o, long long l, long long r) {
  return (pre[o][r] - pre[o][l - 1] * pw[r - l + 1] % mod + mod) % mod;
}
long long hsuf(long long o, long long l, long long r) {
  return (suf[o][l] - suf[o][r + 1] * pw[r - l + 1] % mod + mod) % mod;
}
long long merge(long long x, long long y, long long len) {
  return (x * pw[len] % mod + y) % mod;
}
void add(long long &x, long long y) { x = (x + y) % mod; }
void solve() {
  memset(f, 0, sizeof(f));
  memset(g, 0, sizeof(g));
  for (long long i = 1; i <= m; ++i)
    Hash[i] = (base * Hash[i - 1] % mod + (t[i] - 'a')) % mod;
  for (long long i : {0, 1})
    for (long long j = 1; j <= n; ++j)
      for (long long k = 1; k <= j; ++k) {
        long long len = (j - k + 1) * 2;
        if (len > m) continue;
        long long x = hsuf(!i, k, j), y = hpre(i, k, j), z = Hash[len];
        if (merge(x, y, j - k + 1) == z) len == m ? ++cnt : g[i][j][len] = 1;
      }
  for (long long i : {0, 1})
    for (long long j = 1; j <= n; ++j)
      if (s[i][j] == t[1]) g[i][j][1] = 1;
  for (long long k = 1; k < m; ++k)
    for (long long i : {0, 1})
      for (long long j = 1; j <= n; ++j) {
        if (j < n && s[i][j + 1] == t[k + 1])
          add(f[i][j + 1][k + 1], g[i][j][k]),
              add(f[i][j + 1][k + 1], f[i][j][k]);
        if (s[!i][j] == t[k + 1]) add(g[!i][j][k + 1], f[i][j][k]);
      }
  for (long long i = m; i >= 1; --i)
    Hash[i] = (base * Hash[i + 1] % mod + (t[i] - 'a')) % mod;
  for (long long i : {0, 1}) {
    for (long long j = 1; j <= n; ++j)
      if (s[i][j] == t[m]) {
        if (m == 1) ++ans;
        add(ans, f[i][j - 1][m - 1] + g[i][j - 1][m - 1]);
      }
    for (long long j = 1; j <= n; ++j)
      for (long long k = j; k <= n; ++k) {
        long long len = (k - j + 1) * 2;
        if (len > m) continue;
        long long x = hpre(!i, j, k), y = hsuf(i, j, k), z = Hash[m - len + 1];
        if (merge(x, y, k - j + 1) == z)
          (len == m && m != 2)
              ? (void)++cnt
              : add(ans, f[i][j - 1][m - len] + g[i][j - 1][m - len]);
      }
  }
}
signed main() {
  cin >> (s[0] + 1) >> (s[1] + 1);
  n = strlen(s[0] + 1);
  cin >> (t + 1);
  m = strlen(t + 1);
  pw[0] = 1;
  for (long long i = 1; i <= max(n, m); ++i) pw[i] = pw[i - 1] * base % mod;
  for (long long i : {0, 1}) {
    for (long long j = 1; j <= n; ++j)
      pre[i][j] = (pre[i][j - 1] * base % mod + (s[i][j] - 'a')) % mod;
    for (long long j = n; j >= 1; --j)
      suf[i][j] = (suf[i][j + 1] * base % mod + (s[i][j] - 'a')) % mod;
  }
  solve();
  reverse(t + 1, t + m + 1);
  solve();
  ans = (ans + cnt / 2) % mod;
  if (m == 1) ans = ans * inv2 % mod;
  cout << ans;
  return 0;
}
