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 lld;
typedef pair<int,int> pi;
typedef pair<lld,lld> pl;
typedef pair<int,lld> pil;
typedef pair<lld,int> pli;
typedef vector<int> vit;
typedef vector<vit> vitt;
typedef vector<lld> vlt;
typedef vector<vlt> vltt;
typedef vector<pi> vpit;
typedef vector<vpit> vpitt;
typedef long double ld;
#define x first
#define y second
#define pb push_back
#define all(v) v.begin(), v.end()
#define sz(x) (int)x.size()
#define mk(a,b) make_pair(a,b)
bool isrange(int y,int x,int n,int m){
	 if(0<=y&&y<n&&0<=x&&x<m) return true;
	 return false;
}
int dy[4] = {1,0,-1,0},dx[4]={0,1,0,-1},ddy[8] = {1,0,-1,0,1,1,-1,-1},ddx[8] = {0,1,0,-1,1,-1,1,-1};

const lld mod = 998244353;
const int MAX = 303030;
string arr[MAX];
lld two[MAX];
void solve(int tc){
	int n,m;
	cin >> n >> m;
	int tot = 0;
	for(int p=0;p<n;p++){
		cin >> arr[p];
		for(int q=0;q<m;q++){
			if(arr[p][q]=='o') tot++;
		}
	}
	if(tot<2){
		cout << "0\n";
	}else{
		lld ans = 0;
		two[0] = 1;
		for(int e=1;e<MAX;e++) two[e] = (two[e-1]*2)%mod;
		for(int e=0;e<n;e++){
			int xx = 0;
			for(int p=0;p<m;p++){
				if(arr[e][p]=='o'){
					xx++;
				}else{
					for(int q=2;q<=xx;q++){
						lld vv = (1ll*(xx-q+1)*two[tot-q])%mod;
						if(q%2==0){
							ans = (ans+vv)%mod;
						}else{
							ans = (ans-vv)%mod;
							ans = (ans%mod+mod)%mod;
						}
					}
					xx = 0;
				}
			}
			for(int q=2;q<=xx;q++){
				lld vv = (1ll*(xx-q+1)*two[tot-q])%mod;
				if(q%2==0){
					ans = (ans+vv)%mod;
				}else{
					ans = (ans-vv)%mod;
					ans = (ans%mod+mod)%mod;
				}
			}
		}
		for(int p=0;p<m;p++){
			int xx = 0;
			for(int e=0;e<n;e++){
				if(arr[e][p]=='o'){
					xx++;
				}else{
					for(int q=2;q<=xx;q++){
						lld vv = (1ll*(xx-q+1)*two[tot-q])%mod;
						if(q%2==0){
							ans = (ans+vv)%mod;
						}else{
							ans = (ans-vv)%mod;
							ans = (ans%mod+mod)%mod;
						}
					}
					xx = 0;
				}
			}
			for(int q=2;q<=xx;q++){
				lld vv = (1ll*(xx-q+1)*two[tot-q])%mod;
				if(q%2==0){
					ans = (ans+vv)%mod;
				}else{
					ans = (ans-vv)%mod;
					ans = (ans%mod+mod)%mod;
				}
			}
		}
		cout << ans << "\n";
	}
}


int main(void){
	
	ios_base :: sync_with_stdio(false);
	cin.tie(NULL);
	cout.tie(NULL);
	
	int tc = 1;
	/*
		cin >> tc;
	*/
	for(int test_number=1;test_number<=tc;test_number++){
		solve(test_number);
	}
	return 0;
}