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:
# by the authority of GOD     author: manhar singh sachdev #

import os,sys
from io import BytesIO, IOBase

def main():
    mod = 998244353
    powe = [1]
    for i in range(1,3*10**5+1):
        powe.append((powe[-1]*4)%mod)
    a,b = pow(3,mod-2,mod),pow(9,mod-2,mod)
    dp,su = [0,0],0
    for i in range(2,3*10**5+1):
        z,zz,zzz,zzzz = (i+1)//2,i//2,(i-1)//2,(i-2)//2
        x = (su+zz+(powe[z]*(zzz-z+1)-zzz)*a+(powe[z]-4)*b
             +((powe[zz]*(zzzz-zz+1)-zzzz)*a+(powe[zz]-4)*b)*2)%mod
        dp.append(x)
        su = (su+x)%mod
    n,m = map(int,input().split())
    arr = [input().strip() for _ in range(n)]
    z = sum(arr[i][j]=='o' for i in range(n) for j in range(m))
    powe = [1]
    for i in range(1,3*10**5+1):
        powe.append((powe[-1]*2)%mod)
    ans = 0
    for i in range(n):
        c = 0
        for j in range(m):
            if arr[i][j] == '*' and c:
                ans = (ans+dp[c]*powe[z-c])%mod
                c = 0
            elif arr[i][j] == 'o':
                c += 1
        if c:
            ans = (ans+dp[c]*powe[z-c])%mod
    for i in range(m):
        c = 0
        for j in range(n):
            if arr[j][i] == '*' and c:
                ans = (ans+dp[c]*powe[z-c])%mod
                c = 0
            elif arr[j][i] == 'o':
                c += 1
        if c:
            ans = (ans+dp[c]*powe[z-c])%mod
    print(ans)

# Fast IO Region
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")
if __name__ == "__main__":
    main()