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;
template <class T>
inline void rd(T &x) {
  x = 0;
  char c = getchar();
  int f = 1;
  while (!isdigit(c)) {
    if (c == '-') f = -1;
    c = getchar();
  }
  while (isdigit(c)) x = x * 10 - '0' + c, c = getchar();
  x *= f;
}
const int N = 2010, mod = 1e9 + 7;
inline void Add(int &x, int y) {
  x += y;
  if (x >= mod) x -= mod;
}
const int P = 37;
long long hsh[4][N], pw[N];
void calhsh(char *s, int p, int n) {
  for (int i = 1; i <= n; ++i)
    hsh[p][i] = (hsh[p][i - 1] * P + s[i] - 'a') % mod;
}
long long get(int p, int l, int r) {
  if (p == 3)
    return ((hsh[p][l] - hsh[p][r + 1] * pw[r - l + 1]) % mod + mod) % mod;
  return ((hsh[p][r] - hsh[p][l - 1] * pw[r - l + 1]) % mod + mod) % mod;
}
bool cmp(int p1, int l1, int r1, int p2, int l2, int r2) {
  return get(p1, l1, r1) == get(p2, l2, r2);
}
int f[N][2][N], ans;
int n, m;
char S[2][N], T[N];
void sol() {
  memset(f, 0, sizeof(f));
  for (int i = 2; i <= n; ++i)
    for (int d = 0; d < 2; ++d)
      for (int j = 2; j <= i && j * 2 <= m; ++j)
        if (cmp(d ^ 1, i - j + 1, i, 3, 1, j) &&
            cmp(d, i - j + 1, i, 2, j + 1, j * 2))
          f[i][d][j * 2]++;
  for (int i = 1; i <= n; ++i)
    for (int d = 0; d < 2; ++d) {
      if (T[1] == S[d][i]) f[i][d][1]++;
      if (T[2] == S[d][i] && T[1] == S[d ^ 1][i]) f[i][d][2]++;
    }
  for (int i = 1; i < n; ++i)
    for (int d = 0; d < 2; ++d)
      for (int j = 1; j < m; ++j)
        if (f[i][d][j]) {
          if (S[d][i + 1] == T[j + 1]) {
            Add(f[i + 1][d][j + 1], f[i][d][j]);
            if (j + 2 <= m && S[d ^ 1][i + 1] == T[j + 2])
              Add(f[i + 1][d ^ 1][j + 2], f[i][d][j]);
          }
        }
  for (int i = 0; i <= n; ++i) f[i][0][0] = f[i][1][0] = 1;
  for (int i = 0; i <= n; ++i)
    for (int d = 0; d < 2; ++d)
      for (int j = 0; j <= m; ++j)
        if (f[i][d][j] && !((m - j) & 1)) {
          int l = m - j >> 1;
          if (l > n - i || l == 1) continue;
          if (cmp(d, i + 1, i + l, 2, j + 1, j + l) &&
              cmp(d ^ 1, i + 1, i + l, 3, j + l + 1, m))
            Add(ans, f[i][d][j]);
        }
}
int main() {
  scanf("%s%s%s", S[0] + 1, S[1] + 1, T + 1);
  n = strlen(S[0] + 1), m = strlen(T + 1);
  if (m == 1) {
    int ans = 0;
    for (int i = 0; i < 2; ++i)
      for (int j = 1; j <= n; ++j) ans += S[i][j] == T[1];
    printf("%d", ans);
    return 0;
  }
  if (m == 2) {
    int ans = 0;
    for (int x = 0; x < 2; ++x)
      for (int y = 1; y <= n; ++y)
        if (S[x][y] == T[1]) {
          if (S[x ^ 1][y] == T[2]) ans++;
          if (y > 1 && S[x][y - 1] == T[2]) ans++;
          if (y < n && S[x][y + 1] == T[2]) ans++;
        }
    printf("%d", ans);
    return 0;
  }
  pw[0] = 1;
  for (int i = 1; i <= max(n, m); ++i) pw[i] = pw[i - 1] * P % mod;
  calhsh(S[0], 0, n);
  calhsh(S[1], 1, n);
  calhsh(T, 2, m);
  reverse(T + 1, T + m + 1);
  calhsh(T, 3, m);
  reverse(T + 1, T + m + 1);
  reverse(hsh[3] + 1, hsh[3] + m + 1);
  sol();
  swap(hsh[3], hsh[2]);
  reverse(T + 1, T + m + 1);
  reverse(hsh[3] + 1, hsh[3] + m + 1);
  reverse(hsh[2] + 1, hsh[2] + m + 1);
  sol();
  if (m % 2 == 0) {
    int p = m / 2;
    for (int i = p; i <= n; ++i)
      for (int d = 0; d < 2; ++d) {
        if (cmp(d, i - p + 1, i, 2, 1, p) &&
            cmp(d ^ 1, i - p + 1, i, 3, p + 1, m))
          ans--;
        if (cmp(d, i - p + 1, i, 3, 1, p) &&
            cmp(d ^ 1, i - p + 1, i, 2, p + 1, m))
          ans--;
      }
    ans = (ans % mod + mod) % mod;
  }
  printf("%d", ans);
  return 0;
}
