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:
#!/usr/bin/env python
import os
import sys
from io import BytesIO, IOBase
import threading 
from bisect import bisect_right
from math import gcd,log
from collections import Counter
from pprint import pprint
from itertools import permutations 
from bisect import bisect_right

MOD=998244353
inv3=pow(3,MOD-2,MOD)
def fixt(t,p):
    ans=0
    if p==0:
        return pow(2,t-2,MOD)
    
    od=p
    if p%2==0:
        ans+=pow(2,t-2-p,MOD)
        # print(ans)
        od-=1

    low=t-2-od
    terms=(od+1)//2

    k=inv3*(pow(4,terms,MOD)-1)
    k%=MOD
    k2=pow(2,low,MOD)
    # print(p,terms, k,k2)
    ans+=k*k2
    ans%=MOD
    return ans 


def main():
    n,m=map(int,input().split())
    grid=[]
    t=0
    for i in range(n):
        grid.append([c for c in input()])
        t+=grid[-1].count('o')
    ans=0
    for i in range(n):
        last=0
        for j in range(m):
            if j<m-1 and grid[i][j]==grid[i][j+1]=='o': 
                ans+=fixt(t,last)
                ans%=MOD
            if grid[i][j]=='o':
                last+=1
            else:
                last=0
        # print(ans)
    # print("-------")

    for j in range(m):
        last=0
        for i in range(n):
            if i<n-1 and grid[i][j]==grid[i+1][j]=='o':            
                ans+=fixt(t,last)
                ans%=MOD
            if grid[i][j]=='o':
                last+=1
            else:
                last=0
        # print(ans)
    print(ans%MOD)
    # print('----')

            



    


        
     










        
BUFSIZE = 8192
 
 
class FastIO(IOBase):
    newlines = 0
 
    def __init__(self, file):
        self._fd = file.fileno()
        self.buffer = BytesIO()
        self.writable = "x" in file.mode or "r" not in file.mode
        self.write = self.buffer.write if self.writable else None
 
    def read(self):
        while True:
            b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
            if not b:
                break
            ptr = self.buffer.tell()
            self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)
        self.newlines = 0
        return self.buffer.read()
 
    def readline(self):
        while self.newlines == 0:
            b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
            self.newlines = b.count(b"\n") + (not b)
            ptr = self.buffer.tell()
            self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)
        self.newlines -= 1
        return self.buffer.readline()
 
    def flush(self):
        if self.writable:
            os.write(self._fd, self.buffer.getvalue())
            self.buffer.truncate(0), self.buffer.seek(0)
 
 
class IOWrapper(IOBase):
    def __init__(self, file):
        self.buffer = FastIO(file)
        self.flush = self.buffer.flush
        self.writable = self.buffer.writable
        self.write = lambda s: self.buffer.write(s.encode("ascii"))
        self.read = lambda: self.buffer.read().decode("ascii")
        self.readline = lambda: self.buffer.readline().decode("ascii")
 
 
sys.stdin, sys.stdout = IOWrapper(sys.stdin), IOWrapper(sys.stdout)
input = lambda: sys.stdin.readline().rstrip("\r\n")
 
# endregion
 
if __name__ == "__main__":

    for _ in range(1):
        main()