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 JAVA):

Solution:
/*
bts songs to dance to:
I need U
Run
ON
Filter
I'm fine
 */
import static java.lang.Math.max;
import static java.lang.Math.min;
import static java.lang.Math.abs;
import static java.lang.System.out;
import java.util.*;
import java.io.*;
import java.math.*;

public class x1511E
{
    static final long MOD =  998244353L;
    static final int MAX = 300000;
    public static void main(String hi[]) throws Exception
    {
        //precompute
        long inv2 = power(2, MOD-2, MOD);
        long inv4 = (inv2*inv2)%MOD;
        long[] dp = new long[MAX+1];
        dp[0] = 1L; dp[1] = inv2;
        for(int i=2; i <= MAX; i++)
        {
            dp[i] = inv2+(inv4*dp[i-2])%MOD;
            if(dp[i] >= MOD)
                dp[i] -= MOD;
        }
        BufferedReader infile = new BufferedReader(new InputStreamReader(System.in));
        StringTokenizer st = new StringTokenizer(infile.readLine());
        int N = Integer.parseInt(st.nextToken());
        int M = Integer.parseInt(st.nextToken());
        char[][] grid = new char[N][M];
        for(int r=0; r < N; r++)
            grid[r] = infile.readLine().toCharArray();
        long res = 0L;
        for(int r=0; r < N; r++)
        {
            int cnt = 0;
            for(int c=0; c < M; c++)
            {
                if(grid[r][c] == 'o')
                    cnt++;
                else
                    cnt = 0;
                if(cnt >= 2)
                {
                    res += (inv4*dp[cnt-2])%MOD;
                    if(res >= MOD)
                        res -= MOD;
                }
            }
        }
        //other direction
        for(int c=0; c < M; c++)
        {
            int cnt = 0;
            for(int r=0; r < N; r++)
            {
                if(grid[r][c] == 'o')
                    cnt++;
                else
                    cnt = 0;
                if(cnt >= 2)
                {
                    long temp = (inv2*inv2)%MOD;
                    res += (temp*dp[cnt-2])%MOD;
                    if(res >= MOD)
                        res -= MOD;
                }
            }
        }
        //multiply by 2^w
        int totalW = 0;
        for(int r=0; r < N; r++)
            for(char c: grid[r])
                if(c == 'o')
                    totalW++;
        res = (res*power(2, totalW, MOD))%MOD;
        System.out.println(res);
    }
    public static long power(long x, long y, long p)
    {
        //0^0 = 1
        long res = 1L;
        x = x%p;
        while(y > 0)
        {
            if((y&1)==1)
                res = (res*x)%p;
            y >>= 1;
            x = (x*x)%p;
        }
        return res;
    }
}
/*
for each block of 2, find probability the # of white cells preceding it is even
treat horizontal and vertical independently
combo stuff
 */