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:
// by GolD_Batyr
#include <bits/stdc++.h>
using namespace std;

typedef long long ll;
typedef long double ld;
typedef pair<int, int> pii;
typedef vector<int> vi;

#define pb push_back
#define mp make_pair
#define fi first
#define se second
#define all(x) x.begin(), x.end()
#define sz(x) (int)x.size()
#define y1 y1234567890

#define NAME ""
#define fast_io ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0)
#define file_io freopen(NAME".in", "r", stdin); freopen(NAME".out", "w", stdout)

const int N = 1e5;
const int M = N + 7;
const double EPS = 1e-10;

const int MOD = 998244353;
const ll INF = 1e18 + 17;

int n, m;
int c[100];
ll ans;

ll bip(ll x, ll n, ll MOD) {
  ll res = 1;
  while (n) {
    if (n & 1) res = res * x % MOD;
    x = x * x % MOD;
    n /= 2; 
  } 
  return res;
}

ll mult(ll x, ll y) {
  return x * y % MOD;
}

ll dv(ll x, ll y) {
  return x * bip(y, MOD - 2, MOD) % MOD;
}

ll sub(ll x, ll y) {
  return (x - y + MOD) % MOD;
}

ll add(ll x, ll y) {
  return (x + y) % MOD;
}

void rec(int v) {
  if (v > n) {
    int l = 0;
    for (int i = 1; i <= n; i++) {
      if (c[i] == 1) l++;
      else {
        ans += l / 2;
        l = 0;
      }
    }
    ans += l / 2;
    return;
  }
  c[v] = 1;
  rec(v + 1);
  c[v] = 0;
  rec(v + 1);
}

ll f(int n) {
  if (n == 0) return 0;
  n--;
  ll res = 0;
  if (n & 1) {
    res = dv(mult((3 * n + 1), bip(2, n, MOD)) + 1, 9);
  } else {
    res = dv(mult((3 * n + 1), bip(2, n, MOD)) - 1, 9);
  }
  return res;
}

void solve() {  
  cin >> n >> m;
  
  int w = 0;
  vector <vector <char>> a(n, vector<char>(m));
  for (int i = 0; i < n; i++) for (int j = 0; j < m; j++) {
    cin >> a[i][j];  
    if (a[i][j] == 'o') w++;
  }

  //cout << w << endl;
  for (int i = 0; i < n; i++) {
    int l = 0;
    for (int j = 0; j < m; j++) {
      if (a[i][j] == 'o') l++;
      else {
        //cout << l << endl;
        //ans += f(l) * bip(2, w - l, MOD) % MOD;
        //cout << f(l) << ' ' << bip(2, w - l, MOD) << endl;
        ans = add(ans, mult(f(l), bip(2, w - l, MOD)));
        l = 0;
      }
    }
    //cout << l << endl;
    //cout << f(l) << ' ' << bip(2, w - l, MOD) << endl;
    //ans += f(l) * bip(2, w - l, MOD) % MOD;
    ans = add(ans, mult(f(l), bip(2, w - l, MOD)));
    l = 0;
  }
  //cout << ans << endl;
  //return;
  for (int j = 0; j < m; j++) {
    int l = 0;
    for (int i = 0; i < n; i++) {
      if (a[i][j] == 'o') l++;
      else {
        ans = add(ans, mult(f(l), bip(2, w - l, MOD)));
        l = 0;
      }
    }
    ans = add(ans, mult(f(l), bip(2, w - l, MOD)));
    l = 0;
  }  
  cout << ans;
}

int main() {
  fast_io;
  int tt = 1;
  //cin >> tt;
  while (tt--) {
    solve();
  }
  return 0;
}