Problem: You have a large rectangular board which is divided into n × m cells (the board has n rows and m columns). Each cell is either white or black.

You paint each white cell either red or blue. Obviously, the number of different ways to paint them is 2^w, where w is the number of white cells.

After painting the white cells of the board, you want to place the maximum number of dominoes on it, according to the following rules:

  * each domino covers two adjacent cells; 
  * each cell is covered by at most one domino; 
  * if a domino is placed horizontally (it covers two adjacent cells in one of the rows), it should cover only red cells; 
  * if a domino is placed vertically (it covers two adjacent cells in one of the columns), it should cover only blue cells. 



Let the value of the board be the maximum number of dominoes you can place. Calculate the sum of values of the board over all 2^w possible ways to paint it. Since it can be huge, print it modulo 998 244 353.

Input

The first line contains two integers n and m (1 ≤ n, m ≤ 3 ⋅ 10^5; nm ≤ 3 ⋅ 10^5) — the number of rows and columns, respectively.

Then n lines follow, each line contains a string of m characters. The j-th character in the i-th string is * if the j-th cell in the i-th row is black; otherwise, that character is o.

Output

Print one integer — the sum of values of the board over all 2^w possible ways to paint it, taken modulo 998 244 353.

Examples

Input


3 4
**oo
oo*o
**oo


Output


144


Input


3 4
**oo
oo**
**oo


Output


48


Input


2 2
oo
o*


Output


4


Input


1 4
oooo


Output


9

Solution (in PYTHON3):

Solution:
import sys
input = sys.stdin.readline

mod = 998244353

n,m  = map(int,input().split())
board = [input().strip() for i in range(n)]

ans = 0
tot_c = 0
tot_h = []
tot_v = []

for i in range(n):
    for j in range(m):
        if board[i][j] == 'o':
            tot_c += 1

for i in range(n):
    for j in range(m):
        if board[i][j] == 'o' and (j == 0 or board[i][j-1] == '*'):
            tot_h.append(1)
        elif board[i][j] == 'o':
            tot_h[-1] += 1

for j in range(m):
    for i in range(n):
        if board[i][j] == 'o' and (i == 0 or board[i-1][j] == '*'):
            tot_v.append(1)
        elif board[i][j] == 'o':
            tot_v[-1] += 1

# find the "contribution" (sum of values) of every row and col individually then multiply this
# by the number of ways to tile the other cells not in this row/col (2^everything else)
for num_consec in tot_h + tot_v:
    # num_consec o's in a row or col
    sum_vals = 0

    for sub_len in range(1,num_consec+1):
        leftover = num_consec - sub_len

        if leftover == 0:
            # both endpoints of the subarray are at the endpoints of the o's
            sum_vals += sub_len//2
        if leftover >= 1:
            # one endpoint of the subarray is at one endpoint of the o's
            sum_vals += 2 * (sub_len//2) * pow(2,leftover-1,mod)
        if leftover >= 2:
            # no endpoint of the subarray is at any endpoint of the o's
            sum_vals += (sub_len//2) * (leftover-1) * pow(2,leftover-2,mod)

    sum_vals %= mod
    ans = (ans + sum_vals * pow(2, tot_c-num_consec, mod)) % mod

print(ans)