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

Solution:
#include<bits/stdc++.h>
using namespace std;
string mp[300005];
int const p=998244353;
int pw(int x,int y)
{
    int res=1;
    while(y)
    {
        if(y&1)res=1ll*res*x%p;
        x=1ll*x*x%p;
        y>>=1;
    }
    return res;
}
vector<int>lef[300005],up[300005];
int t[300005];
int main()
{
    int n,m,s=0,cnt=0,cnta=0,cntb=0,cntc=0,cntd=0,cnte=0;
    cin>>n>>m;
    for(int i=0;i<n;i++)cin>>mp[i];
    for(int i=0;i<n;i++)
        for(int j=0;j<m;j++)
            if(mp[i][j]=='o')cnt++;
    for(int i=0;i<n;i++)
    {
        lef[i].resize(m);lef[i][0]=(mp[i][0]=='o');
        up[i].resize(m);
        for(int j=1;j<m;j++)
        {
            if(mp[i][j]=='o')lef[i][j]=lef[i][j-1]+1;
            if(lef[i][j]>=2)t[lef[i][j]+1]--,t[2]++;
        }
    }
    for(int j=0;j<m;j++)
    {
        up[0][j]=(mp[0][j]=='o');
        for(int i=1;i<n;i++)
        {
            if(mp[i][j]=='o')up[i][j]=up[i-1][j]+1;
            if(up[i][j]>=2)t[up[i][j]+1]--,t[2]++;
        }
    }
    int ans=0;
    for(int i=2;i<=max(n,m);i++)
    {
        t[i]=(t[i]+t[i-1])%p;
        if(t[i])ans=(ans+1ll*((i&1)?p-1:1)*t[i]%p*pw(2,cnt-i))%p;
    }
    printf("%d",ans);
    return 0;
}