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:
// written by: soumya_27
#include<bits/stdc++.h>
// #include <ext/pb_ds/assoc_container.hpp>
// #include <ext/pb_ds/tree_policy.hpp>
#define int long long
#define ld long double
#define mod 998244353////((int)1e18+7)//
#define M_PI 3.14159265358979323846
#define maxx ((int)2e7+7)
#define pb push_back
#define ins insert
#define F first
#define S second
#define ins insert
#define pii pair <int , int>
#define lb lower_bound
#define ub upper_bound
#define usefile freopen("input.txt","r",stdin); freopen("ou(tp)ut.txt","w",stdout);
#define fast ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define test int t; cin >> t; while(t--)
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
int exp(int x, int y, int p) {x %= p; int res = 1; while (y) {if (y % 2) res = (res * x % p) % p; x = (x * x) % p; y /= 2; } return res;}
int expo(int x, int y) { int res = 1; while (y) {if (y % 2) res = (res * x % mod) % mod; x = (x * x) % mod; y /= 2; } return res;}
int add(int a, int b) {return (a % mod + b % mod + mod) % mod;}
int sub(int a, int b) {return (a % mod - b % mod + mod) % mod;}
int mul(int a, int b) {return ((a % mod) * (b % mod) + mod) % mod;}
int inv(int x) {return expo(x, mod - 2);}
#define debug(...) fprintf(stderr, __VA_ARGS__), fflush(stderr)
#define time__(d) for(long blockTime = 0; (blockTime == 0 ? (blockTime=clock()) != 0 : false); debug("%s time : %.4fs", d, (double)(clock() - blockTime) / CLOCKS_PER_SEC))
int sv[20000007]={0};

// int fact[1000006]={0};
// void facto() {fact[0]=1;fact[1]=1;for(int i=2;i<1000006;i++)fact[i]=(fact[i-1]*i)%mod;}
void sve() {sv[0]=1;sv[1]=1;for(int i=2;i<maxx;i++)sv[i] = i;for(int i=2;i*i<maxx;i++){if(sv[i]==i){for(int j=i*i;j<maxx;j+=i)if(sv[j] == j)sv[j]=i;}}}//i hai to prime
// int ncr(int n,int r) {int res=1; res=fact[n]; res=(res*(expo(fact[r],mod-2)))%mod; res=(res*(expo(fact[n-r],mod-2)))%mod; return res;}
// int npr(int n,int r) {int res=1; res=fact[n]; res=(res*(expo(fact[n-r],mod-2)))%mod; return res;}
// using namespace __gnu_pbds;
// #define p_set tree< pair<int,int> ,  null_type ,  less<pair<int,int>> ,  rb_tree_tag ,  tree_order_statistics_node_update>
// #define i_set tree< int ,  null_type ,  less< int > ,  rb_tree_tag ,  tree_order_statistics_node_update>
using namespace std;
#define N 400005
int tp[N] = {0};
int d[N] = {0}, c=0; 
// ...B ...BW ...WW
// f(n) = {f(n-1)} + {f(n-2)} +  {f(n-2) + 2^(n-2)} // cont of all 
void solve()
{
  fast
  int i, j;
// tp
  tp[0] = 1;
  for(int i=1 ; i<N ; i++)
    tp[i] = mul(tp[i-1], 2);

  // test
  {
    int n, m, i, j, q, k, ans=0;
    cin >> n >> m;
    string s[n];
    for(i=0 ; i<n ; i++)
    {
      cin >> s[i];
      for(j=0 ; j<m ; j++)
        if(s[i][j] == 'o')
          c++;
    }

    d[0] = 0;
    d[1] = 0;
    d[2] = 1;
    for(i=3 ; i<N ; i++)
        d[i] = add(d[i-1], add(tp[i-2], mul(2, d[i-2])));

    for(i=0 ; i<n ; i++)
    {
      for(j=0 ; j<m ; j++)
      {
        if(s[i][j] == 'o')
        {
          for(k=j+1 ; k<m ; k++)
            if(s[i][k] == '*')
              break;
            ans = add(ans, mul(d[k-j], tp[c-(k-j)]));
          j = k;
        }
      }
    }
    for(j=0 ; j<m ; j++)
    {
      for(i=0 ; i<n ; i++)
      {
        if(s[i][j] == 'o')
        {
          for(k=i+1 ; k<n ; k++)
            if(s[k][j] == '*')
              break;
            ans = add(ans, mul(d[k-i], tp[c-(k-i)]));
          i = k;
        }
      }
    }
    cout << ans << "\n";
  }
}
 
signed main()
{
  // time__("solve")
  {
    solve();
  }
  return 0;
}