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.io.*;
import java.util.*;

public class CF1511E extends PrintWriter {
	CF1511E() { super(System.out, true); }
	Scanner sc = new Scanner(System.in);
	public static void main(String[] $) {
		CF1511E o = new CF1511E(); o.main(); o.flush();
	}

	static final int A = 300000, MD = 998244353;
	void main() {
		int[] pp = new int[A + 1];
		for (int p = 1, a = 0; a <= A; a++) {
			pp[a] = p;
			p = p * 2 % MD;
		}
		int[] dp = new int[A + 1];
		for (int a = 2; a <= A; a++)
			dp[a] = (int) ((dp[a - 1] + dp[a - 2] * 2L + pp[a - 2]) % MD);
		int n = sc.nextInt();
		int m = sc.nextInt();
		byte[][] cc = new byte[n][];
		for (int i = 0; i < n; i++)
			cc[i] = sc.next().getBytes();
		int k = 0;
		for (int i = 0; i < n; i++)
			for (int j = 0; j < m; j++)
				if (cc[i][j] == 'o')
					k++;
		long ans = 0;
		for (int i = 0; i < n; i++) {
			int a = 0;
			for (int j = 0; j <= m; j++)
				if (j < m && cc[i][j] == 'o')
					a++;
				else if (a > 0) {
					ans = (ans + (long) dp[a] * pp[k - a]) % MD;
					a = 0;
				}
		}
		for (int j = 0; j < m; j++) {
			int a = 0;
			for (int i = 0; i <= n; i++)
				if (i < n && cc[i][j] == 'o')
					a++;
				else if (a > 0) {
					ans = (ans + (long) dp[a] * pp[k - a]) % MD;
					a = 0;
				}
		}
		println(ans);
	}
}