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 JAVA):

Solution:
import java.util.*;
import java.io.*;

public class E
{

	static FastIO f;

	public static void main(String args[]) throws IOException
	{
		f = new FastIO();

		int n = f.ni(), m = f.ni(), i, j;
		char[][] g;
		long[][] be, bf, re, rf;
		long pr = 998244353L, ans = 0L, c = 0L;

		g = new char[n][];
		for(i = 0; i < n; i++)
		{
			g[i] = f.nca();
			for(j = 0; j < m; j++)
				if(g[i][j] == 'o')
					c++;
		}

		c = pow(2L, c, pr);
		long m2 = pow(2L, pr-2L, pr);

		be = new long[n][m];
		bf = new long[n][m];
		re = new long[n][m];
		rf = new long[n][m];

		if(g[0][0] == 'o')
		{
			be[0][0] = (c*m2)%pr;
			re[0][0] = (c*m2)%pr;
		}

		for(i = 1; i < m; i++)
		{
			if(g[0][i] == '*')
				continue;

			if(g[0][i-1] == '*')
			{
				be[0][i] = (c*m2)%pr;
				re[0][i] = (c*m2)%pr;
			}
			else
			{
				bf[0][i] = (be[0][i-1]*m2)%pr;
				be[0][i] = ((c*m2)%pr - bf[0][i] + pr)%pr;
				re[0][i] = (c*m2)%pr;
			}
		}

		for(i = 1; i < n; i++)
		{
			// f.err(i + "\n");
			if(g[i][0] == '*')
				bf[i][0] = 0;
			else
			{
				be[i][0] = (c*m2)%pr;

				if(g[i-1][0] == '*')
				{
					re[i][0] = (c*m2)%pr;
				}
				else
				{
					rf[i][0] = (re[i-1][0]*m2)%pr;
					re[i][0] = ((c*m2)%pr - rf[i][0] + pr)%pr;
				}
			}

			for(j = 1; j < m; j++)
			{
				if(g[i][j] == '*')
					continue;

				if(g[i][j-1] == '*')
					be[i][j] = (c*m2)%pr;
				else
				{
					bf[i][j] = (be[i][j-1]*m2)%pr;
					be[i][j] = ((c*m2)%pr - bf[i][j] + pr)%pr;
				}

				if(g[i-1][j] == '*')
				{
					re[i][j] = (c*m2)%pr;
				}
				else
				{
					rf[i][j] = (re[i-1][j]*m2)%pr;
					re[i][j] = ((c*m2)%pr - rf[i][j] + pr)%pr;
				}
			}
		}

		for(i = 0; i < n; i++)
			for(j = 0; j < m; j++)
				ans = (ans + bf[i][j] + rf[i][j])%pr;

		// for(i = 0; i < n; i++)
		// 	f.err(Arrays.toString(be[i]) + "\n");
		// f.err("\n");

		// for(i = 0; i < n; i++)
		// 	f.err(Arrays.toString(bf[i]) + "\n");
		// f.err("\n");

		// for(i = 0; i < n; i++)
		// 	f.err(Arrays.toString(re[i]) + "\n");
		// f.err("\n");

		// for(i = 0; i < n; i++)
		// 	f.err(Arrays.toString(rf[i]) + "\n");
		// f.err("\n");

		f.out(ans + "\n");

		f.flush();
	}

	public static long pow(long x, long y, long mod)
	{
		long res = 1L;
		x %= mod;
	
		while(y > 0)
		{
			if((y&1) == 1)
				res = (res*x)%mod;
			x = (x*x)%mod;
			y >>= 1;
		}
	
		return res;
	}

	public static class FastIO
	{
		BufferedReader br;
		BufferedWriter bw, be;
		StringTokenizer st;

		public FastIO()
		{
			br = new BufferedReader(new InputStreamReader(System.in));
			bw = new BufferedWriter(new OutputStreamWriter(System.out));
			be = new BufferedWriter(new OutputStreamWriter(System.err));
			st = new StringTokenizer("");
		}

		private void read() throws IOException
		{
			st = new StringTokenizer(br.readLine());
		}

		public String ns() throws IOException
		{
			while(!st.hasMoreTokens())
				read();
			return st.nextToken();
		}

		public int ni() throws IOException
		{
			return Integer.parseInt(ns());
		}

		public long nl() throws IOException
		{
			return Long.parseLong(ns());
		}

		public float nf() throws IOException
		{
			return Float.parseFloat(ns());
		}

		public double nd() throws IOException
		{
			return Double.parseDouble(ns());
		}

		public char nc() throws IOException
		{
			return ns().charAt(0);
		}

		public int[] nia(int n) throws IOException
		{
			int[] a = new int[n];
			for(int i = 0; i < n; i++)
				a[i] = ni();

			return a;
		}

		public long[] nla(int n) throws IOException
		{
			long[] a = new long[n];
			for(int i = 0; i < n; i++)
				a[i] = nl();

			return a;
		}

		public char[] nca() throws IOException
		{
			return ns().toCharArray();
		}

		public void out(String s) throws IOException
		{
			bw.write(s);
		}

		public void flush() throws IOException
		{
			bw.flush();
			be.flush();
		}

		public void err(String s) throws IOException
		{
			be.write(s);
		}
	}
}