# #P2022B. Subsequence

# Subsequence

# Subsequence

Time limit: 1 seconds

Memory limit: 512 megabytes

### Problem Statement

We define the "JIE number" of a string $T$ is the number of triples $(i,j,k)$ that satisfy all the following conditions:

1.$1\leq i < j < k \leq |T|$($|T|$ is the length of $T$).

2.$T_i = 'J', T_j = 'I', T_k = 'E'$.

Frank is given a string $S$ that contains only 3 characters: $'J','I','E'$. However, due to hacker's attack, some characters of $S$ are replaced with $'?'$.If $Q$ is the number of the occurrences of $'?'$ in $S$, we can make $3^Q$ strings by replacing each occurrence of '?' in S with $'J'$,$'I'$,$'E'$.

Frank is now wonder the sum of JIE numbers of all the $3^Q$ strings. This is easy for him so he ask you to solve it.

Since the answer may be very large, you only need to tell him the result modulo $998244353$.

### Input

The input contains only one string $S(3\leq|S|\leq10^5)$. It is guaranteed that each character in $S$ is 'J','I','E' or '?'.

### Output

Print a single integer, denoting the answer to the question modulo $998244353$.

```
J??E
```

```
8
```

### Notes

The $3^Q$ strings are: $JJJE,JJIE,JJEE,JIJE,JIIE,JIEE,JEJE,JEIE,JEEE$, and their contribution to the answer are: $0+2+0+1+2+2+0+1+0 = 8$.