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;
typedef long long int ll;
#define pi 3.1415926535897932384626433832
#define endl "\n"
#define debug1(x) cout << #x << " = " << x << '\n';
#define debug2(x, y) cout << #x << " = " << x << "   " << #y << " = " << y << "\n";
#define debug3(x, y,z) cout << #x << " = " << x << "   " << #y << " = " << y << " "<<#z<<" = "<<z<<"\n";
#define f(i,n) for(int i=0;i<n;i++)
#define debugarr(arr) f(i,arr.size()) cout << arr[i] << " "; cout << endl;
#define debugarr2(arr) f(i,arr.size()){f(j,arr[i].size()) cout<<arr[i][j]<<" "; cout<<endl;}
#define pp pair<int,int>
#define mp make_pair
#define fi first
#define se second
#define pb push_back
#define all(x) (x).begin(), (x).end()
#define mod 998244353
ll gcd(ll a, ll b) {return a==0 ? b : gcd(b%a,a);}
bool sortcol(const vector<ll> &v1, const vector<ll> &v2){ return v1[1] < v2[1]; }


void solve()
{
  ll N;
  cin >> N;
  vector<ll> arr(N);
  f(i,N)cin>>arr[i];
}

int main()
{
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  ll t = 1;
  // cin >> t;
  vector<ll> ans(300001);
  vector<ll> add(300001);
  vector<ll> pow(300001);
  add[0] = 0;
  add[1] = 0;
  add[2] = 0;
  add[3] = 1;
  add[4] = 3;
  ll power = 4;
  for(int i = 5;i<300001;i++)
  {
    power*=2;
    power%=mod;
    add[i] = (power - add[i-1] + mod)%mod;
  }
  ans[0] = 0;
  ans[1] = 0;
  ans[2] = 1;
  for(int i = 3;i<300001;i++)
  {
    ans[i] = ans[i-1]*2;
    ans[i]%=mod;
    ans[i] += add[i]; 
  }
  pow[0] = 1;
  pow[1] = 2;
  for(int i = 2;i<300001;i++)
  {
    pow[i] = pow[i-1]*2;
    pow[i]%=mod;
  }
  while (t--)
  {
    ll N,M;
    cin>>N>>M;
    vector<string> s(N);
    ll finalans = 0;
    for(int i = 0;i<N;i++)
    {
      cin>>s[i];
    }
    ll count = 0;
    for(int i = 0;i<N;i++)
    {
      for(int j = 0;j<M;j++)
      {
        if(s[i][j] == 'o')
        {
          count++;
        }
      }
    }
    for(int i = 0;i<N;i++)
    {
      ll counthori = 0;
      for(int j = 0;j<M;j++)
      {
        if(s[i][j]=='o')
        {
          counthori++;
        }
        else
        {
          ll total = 1;
          total*=pow[count-counthori];
          total%=mod;
          total*=ans[counthori];
          total%=mod;
          finalans+=total;
          finalans%=mod;
          counthori = 0;
        }
      }
          ll total = 1;
          total*=pow[count-counthori];
          total%=mod;
          total*=ans[counthori];
          total%=mod;
          finalans+=total;
          finalans%=mod;
          counthori = 0;
    }
    for(int i = 0;i<M;i++)
    {
      ll counthori = 0;
      for(int j = 0;j<N;j++)
      {
        if(s[j][i]=='o')
        {
          counthori++;
        }
        else
        {
          ll total = 1;
          total*=pow[count-counthori];
          total%=mod;
          total*=ans[counthori];
          total%=mod;
          finalans+=total;
          finalans%=mod;
          counthori = 0;
        }
      }
      ll total = 1;
          total*=pow[count-counthori];
          total%=mod;
          total*=ans[counthori];
          total%=mod;
          finalans+=total;
          finalans%=mod;
          counthori = 0;
    }
  cout<<finalans<<endl;
  }
}

/*
_________________ IMP NOTES __________________
a = 97
A = 65
*/