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 int N = 2005, mod = 1e9 + 7;
struct H {
  int x, y;
  H(int x = 0, int y = 0) : x(x), y(y) {}
  H operator+(const H &tmp) const {
    return H((x + tmp.x) % mod, (y + tmp.y) % mod);
  }
  H operator+(const int &tmp) const {
    return H((x + tmp) % mod, (y + tmp) % mod);
  }
  H operator-(const H &tmp) const {
    return H((x + mod - tmp.x) % mod, (y + mod - tmp.y) % mod);
  }
  H operator*(const H &tmp) const {
    return H(1ll * x * tmp.x % mod, 1ll * y * tmp.y % mod);
  }
  bool operator!=(const H &tmp) const { return x != tmp.x || y != tmp.y; }
} base[N], h[3][2][N];
const H p(131, 133);
string s[3];
int n, m, ans, ans2, a[2][N][N], b[2][N][N], f[2][N][N], g[2][N][N];
H get(int t, int o, int l, int r) {
  if (!t) return h[o][t][r] - h[o][t][l - 1] * base[r - l + 1];
  return h[o][t][l] - h[o][t][r + 1] * base[r - l + 1];
}
int check(int t, int i, int j, int k) {
  if (!t) {
    if (j < k) return 0;
    if (get(1, i ^ 1, j - k + 1, j) != get(0, 2, 1, k)) return 0;
    if (get(0, i, j - k + 1, j) != get(0, 2, k + 1, k << 1)) return 0;
    return 1;
  }
  if (n - j + 1 < k) return 0;
  if (get(0, i, j, j + k - 1) != get(0, 2, m - 2 * k + 1, m - k)) return 0;
  if (get(1, i ^ 1, j, j + k - 1) != get(0, 2, m - k + 1, m)) return 0;
  return 1;
}
void solve() {
  for (int i = 1; i <= m; ++i)
    h[2][0][i] = h[2][0][i - 1] * p + (s[2][i] - 'a' + 1);
  for (int i = 0; i < 2; ++i)
    for (int j = 1; j <= n; ++j)
      for (int k = 1; k <= m; ++k) {
        f[i][j][k] = g[i][j][k] = 0;
        if (k == 1) {
          a[i][j][k] = g[i][j][k] = s[i][j] == s[2][1];
          b[i][j][k] = s[i][j] == s[2][m];
        } else if (k % 2 == 0) {
          a[i][j][k] = g[i][j][k] = check(0, i, j, k >> 1);
          b[i][j][k] = check(1, i, j, k >> 1);
        }
        if (k == m) {
          ans2 += a[i][j][k];
          if (m > 2) ans2 += b[i][j][k];
        }
      }
  for (int k = 1; k <= m; ++k)
    for (int i = 0; i < 2; ++i)
      for (int j = 1; j <= n; ++j) {
        if (s[i][j] == s[2][k])
          (f[i][j][k] += (f[i][j - 1][k - 1] + g[i][j - 1][k - 1]) % mod) %=
              mod,
              (g[i][j][k] += f[i ^ 1][j][k - 1]) %= mod;
        if (b[i][j + 1][m - k]) (ans += (f[i][j][k] + g[i][j][k]) % mod) %= mod;
      }
}
int main() {
  ios::sync_with_stdio(false);
  cin >> s[0] >> s[1] >> s[2];
  n = s[0].length();
  m = s[2].length();
  s[0] = "#" + s[0], s[1] = "#" + s[1], s[2] = "#" + s[2];
  base[0] = H(1, 1);
  for (int i = 1; i <= max(n, m); ++i) base[i] = base[i - 1] * p;
  for (int i = 0; i < 2; ++i) {
    for (int j = 1; j <= n; ++j)
      h[i][0][j] = h[i][0][j - 1] * p + (s[i][j] - 'a' + 1);
    for (int j = n; j >= 1; --j)
      h[i][1][j] = h[i][1][j + 1] * p + (s[i][j] - 'a' + 1);
  }
  solve();
  reverse(++s[2].begin(), s[2].end());
  solve();
  ans2 = 1ll * ans2 * ((mod + 1) / 2) % mod;
  (ans += ans2) %= mod;
  cout << ans << endl;
  return 0;
}
