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;
inline int read() {
  char ch = getchar();
  int nega = 1;
  while (!isdigit(ch)) {
    if (ch == '-') nega = -1;
    ch = getchar();
  }
  int ans = 0;
  while (isdigit(ch)) {
    ans = ans * 10 + ch - 48;
    ch = getchar();
  }
  if (nega == -1) return -ans;
  return ans;
}
void print(vector<int> x) {
  for (int i = 0; i < (int)x.size(); i++)
    printf("%d%c", x[i], " \n"[i == (int)x.size() - 1]);
}
inline int add(int x, int y) {
  return x + y >= 1000000007 ? x + y - 1000000007 : x + y;
}
inline int add(int x, int y, int z) { return add(add(x, y), z); }
inline int sub(int x, int y) { return x - y < 0 ? x - y + 1000000007 : x - y; }
inline int mul(int x, int y) { return 1LL * x * y % 1000000007; }
inline int mul(int x, int y, int z) { return mul(mul(x, y), z); }
void inc(int &x, int y) { x = add(x, y); }
char s[2][2005], t[2005];
const int B = 13131;
int hs[2][2005], ht[2005], pw[2005];
int lcp[2][2][2005][2005];
int n, m, f[2][2005][2005];
void init() {
  pw[0] = 1;
  for (int i = 1; i < 2005; i++) pw[i] = mul(pw[i - 1], B);
  for (int i = 0; i < 2; i++)
    for (int j = 1; j <= n; j++) hs[i][j] = add(mul(hs[i][j - 1], B), s[i][j]);
  for (int i = 1; i <= m; i++) ht[i] = add(mul(ht[i - 1], B), t[i]);
  for (int i = 0; i < 2; i++) {
    for (int j = 1; j <= n; j++)
      for (int k = 1; k <= m; k++) {
        if (s[i][j] == t[k])
          lcp[0][i][j][k] = lcp[0][i][j - 1][k + 1] + 1;
        else
          lcp[0][i][j][k] = 0;
      }
  }
  for (int i = 0; i < 2; i++) {
    for (int j = n; j >= 1; j--)
      for (int k = 1; k <= m; k++) {
        if (s[i][j] == t[k])
          lcp[1][i][j][k] = lcp[1][i][j + 1][k + 1] + 1;
        else
          lcp[1][i][j][k] = 0;
      }
  }
}
int geths(int i, int l, int r) {
  return sub(hs[i][r], mul(hs[i][l - 1], pw[r - l + 1]));
}
int getht(int l, int r) { return sub(ht[r], mul(ht[l - 1], pw[r - l + 1])); }
int solve() {
  memset(f, 0, sizeof(f));
  for (int i = 1; i <= n; i++) {
    for (int j = i; j >= 1; j--) {
      int len = 2 * (i - j) + 1;
      if (len <= m && len != 3) {
        for (int o = 0; o < 2; o++) {
          if (lcp[0][o ^ 1][i - 1][1] >= i - j &&
              lcp[1][o][j][i - j + 1] >= i - j + 1) {
            inc(f[o][i][len], 1);
          }
        }
      } else if (len != 3)
        break;
    }
    if (i == n) break;
    for (int o = 0; o < 2; o++) {
      for (int k = 1; k <= m; k++) {
        if (s[o][i + 1] == t[k + 1]) inc(f[o][i + 1][k + 1], f[o][i][k]);
        if (s[o ^ 1][i] == t[k + 1] && s[o ^ 1][i + 1] == t[k + 2])
          inc(f[o ^ 1][i + 1][k + 2], f[o][i][k]);
      }
    }
  }
  int ans = 0;
  for (int o = 0; o < 2; o++)
    for (int i = 1; i <= n; i++) {
      ans = add(ans, f[o][i][m]);
      for (int k = 1; k < m; k++) {
        int ned = m - k + 1, len = ned / 2;
        if (ned & 1) continue;
        if (i + len - 1 > n) continue;
        if (lcp[1][o][i][k] >= len &&
            lcp[0][o ^ 1][i + len - 1][k + len] >= len)
          ans = add(ans, f[o][i][k]);
      }
    }
  return ans;
}
signed main() {
  scanf("%s%s%s", s[0] + 1, s[1] + 1, t + 1);
  n = strlen(s[1] + 1), m = strlen(t + 1);
  if (m == 1) {
    int ans = 0;
    for (int o = 0; o < 2; o++)
      for (int i = 1; i <= n; i++)
        if (s[o][i] == t[1]) ans++;
    cout << ans << endl;
    return 0;
  }
  if (m == 2) {
    int ans = 0;
    for (int o = 0; o < 2; o++) {
      for (int i = 1; i < n; i++)
        if (s[o][i] == t[1] && s[o][i + 1] == t[2]) ans++;
      for (int i = 1; i < n; i++)
        if (s[o][i + 1] == t[1] && s[o][i] == t[2]) ans++;
    }
    for (int i = 1; i <= n; i++)
      if (s[0][i] == t[1] && s[1][i] == t[2]) ans++;
    for (int i = 1; i <= n; i++)
      if (s[0][i] == t[2] && s[1][i] == t[1]) ans++;
    cout << ans << endl;
    return 0;
  }
  init();
  int ans = solve();
  reverse(s[0] + 1, s[0] + n + 1), reverse(s[1] + 1, s[1] + n + 1);
  init();
  ans = add(ans, solve());
  cout << ans << endl;
  return 0;
}