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;
#define int long long
inline int read()
{
	int	s	= 0, w = 1;
	char	ch	= getchar();
	while ( ch<'0' || ch>'9' )
	{
		if ( ch == '-' )
			w = -1;
		ch = getchar();
	}
	while ( ch >= '0' && ch <= '9' )
		s = s * 10 + ch - '0', ch = getchar();
	return(s * w);
}


const int p = 998244353;
int qp( int x, int y )
{
	int res = 1;
	for ( int t = x; y; y >>= 1, t = t * t % p )
		if ( y & 1 )
			res = res * t % p;
	return(res);
}


char		s[1000003];
vector<bool>	v[300003];
vector<int>	v1[300003], v2[300003];
int		F[300003];
signed main()
{
	int n = read(), m = read();
	F[2] = F[3] = 1, F[4] = 2;
	for ( int i = 5; i <= 300000; i += 2 )
		F[i] = (F[i - 2] * 4 + 1) % p;
	for ( int i = 6; i <= 300000; i += 2 )
		F[i] = (F[i - 2] * 4 + 2) % p;
	for ( int i = 4; i <= 300000; i += 2 )
		F[i] = (F[i] + 1) % p;
	int C = 0;
	for ( int i = 0; i < n; ++i )
	{
		scanf( "%s", s + 1 );
		for ( int j = 1; j <= m; ++j )
			C += (s[j] == 'o'),
			v[i].push_back( (s[j] == 'o') ),
			v1[i].push_back( (s[j] == 'o') ),
			v2[i].push_back( (s[j] == 'o') );
	}
	for ( int i = 1; i <= C; ++i )
		F[i] = F[i] * qp( 2, C - i ) % p;
	int ans = 0;
	for ( int i = 1; i < n; ++i )
		for ( int j = 0; j < m; ++j )
			if ( v1[i][j] )
				v1[i][j] += v1[i - 1][j], ans = (ans + F[ v1[i][j] ] ) % p;
	for ( int i = 0; i < n; ++i )
		for ( int j = 1; j < m; ++j )
			if ( v2[i][j] )
				v2[i][j] += v2[i][j - 1], ans = (ans + F[ v2[i][j] ] ) % p;
	printf( "%lld\n", ans );
	return(0);
}