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>
char gb[65536], pb[65536], *gp = gb + 65536, *pp = pb, a[2][2005], s[2005];
int _5[65], n = 0, m = 0, f[2][2005][2005];
long long seed[2005];
inline void add(int &x, int y) {
  x += y;
  if (x >= 1e9 + 7) x -= 1e9 + 7;
}
inline int gline(char *b) {
  char c = getchar();
  int len = 0;
  for (; !(((c)&64)); c = getchar())
    ;
  for (; ((c)&64); b[++len] = c, c = getchar())
    ;
  b[++len] = 0;
  return len - 1;
}
inline void init() {
  seed[0] = 1;
  for (int i = 1; i <= 2005; i++) seed[i] = seed[i - 1] * 31 % 19260817;
}
inline void reverse(char *str, int len) {
  if (!str) return;
  for (register int i = 0; i < (len >> 1); i++) {
    char temp = *(str + i);
    *(str + i) = *(str + len - 1 - i);
    *(str + len - 1 - i) = temp;
  }
}
struct hash {
  long long h[2005];
  inline void make(int n, char *b) {
    h[0] = 0;
    for (register int i = 1; i <= n; i++)
      h[i] = (h[i - 1] * 31 + b[i] - 'a') % 19260817;
  }
  inline void make_r(int n, char *b) {
    h[0] = 0;
    for (register int i = 1; i <= n; i++)
      h[i] = (h[i - 1] * 31 + b[n + 1 - i] - 'a') % 19260817;
  }
  inline long long cut(int l, int r) {
    return (h[r] + 19260817 - h[l - 1] * seed[r - l + 1] % 19260817) % 19260817;
  }
} pre[2], suf[2], ss;
inline void __input() {
  n = gline(a[0]);
  pre[0].make(n, a[0]);
  suf[0].make_r(n, a[0]);
  n = gline(a[1]);
  pre[1].make(n, a[1]);
  suf[1].make_r(n, a[1]);
  m = gline(s);
  ss.make(m, s);
}
inline int solve(int flag) {
  int ret = 0;
  memset(f, 0, sizeof(f));
  for (register int j = 1; j <= n; j++) {
    f[0][j][0] = f[1][j][0] = 1;
    for (int k = 2;
         k <= (((n - j + 1) < ((m >> 1))) ? (n - j + 1) : ((m >> 1))); k++)
      if (ss.cut(m - (k << 1) + 1, m - k) == pre[0].cut(j, j + k - 1) &&
          ss.cut(m - k + 1, m) == suf[1].cut(n - (j + k) + 2, n - j + 1))
        if ((k << 1) != m || flag) add(ret, f[0][j][m - (k << 1)]);
    for (int k = 2;
         k <= (((n - j + 1) < ((m >> 1))) ? (n - j + 1) : ((m >> 1))); k++)
      if (ss.cut(m - (k << 1) + 1, m - k) == pre[1].cut(j, j + k - 1) &&
          ss.cut(m - k + 1, m) == suf[0].cut(n - (j + k) + 2, n - j + 1))
        if ((k << 1) != m || flag) add(ret, f[1][j][m - (k << 1)]);
    for (int k = 2; k <= (((j) < ((m >> 1))) ? (j) : ((m >> 1))); k++)
      if (ss.cut(k + 1, (k << 1)) == pre[0].cut(j - k + 1, j) &&
          ss.cut(1, k) == suf[1].cut(n - j + 1, n - (j - k)))
        if ((k << 1) != m || flag) add(f[0][j + 1][(k << 1)], 1);
    for (int k = 2; k <= (((j) < ((m >> 1))) ? (j) : ((m >> 1))); k++)
      if (ss.cut(k + 1, (k << 1)) == pre[1].cut(j - k + 1, j) &&
          ss.cut(1, k) == suf[0].cut(n - j + 1, n - (j - k)))
        if ((k << 1) != m || flag) add(f[1][j + 1][(k << 1)], 1);
    for (int k = 0; k < m; k++)
      if (a[0][j] == s[k + 1]) {
        add(f[0][j + 1][k + 1], f[0][j][k]);
        if (k + 2 <= m && a[1][j] == s[k + 2])
          add(f[1][j + 1][k + 2], f[0][j][k]);
      }
    for (int k = 0; k < m; k++)
      if (a[1][j] == s[k + 1]) {
        add(f[1][j + 1][k + 1], f[1][j][k]);
        if (k + 2 <= m && a[0][j] == s[k + 2])
          add(f[0][j + 1][k + 2], f[1][j][k]);
      }
    add(ret, f[0][j + 1][m]);
    add(ret, f[1][j + 1][m]);
  }
  return ret;
}
int main() {
  init();
  __input();
  int register ans = 0;
  add(ans, solve(1));
  if (m > 1) {
    reverse(s + 1, m);
    ss.make(m, s);
    add(ans, solve(0));
    if (m == 2)
      for (int j = 1; j <= n; j++)
        for (int i = 0; i < 2; i++)
          if (a[i][j] == s[1] && a[i ^ 1][j] == s[2]) add(ans, 1e9 + 7 - 1);
  }
  printf("%d", ans);
  ;
  return 0;
}