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.Scanner;

public class ColoringsAndDominoes {
	// "Cached"
	public static long[] r_of_n, e_of_n, powers_2;
	public static int total_white=0, n, m;
	public static boolean[][] board;
	
	public static void main(String[] args) {
		Scanner stdin = new Scanner(System.in);
		r_of_n = new long[300001];
		e_of_n = new long[300001];
		powers_2 = new long[300001];
		// Set up recursive values based on combinatorics
		e_of_n[0]=1; e_of_n[1] = 1; r_of_n[0]=0; r_of_n[1]=0; powers_2[0]=1;
		for (int i=2; i<300001; i++) e_of_n[i] = (e_of_n[i-1] + 2*e_of_n[i-2]) % 998244353;
		for (int i=2; i<300001; i++) r_of_n[i] = (e_of_n[i-2] + 2*r_of_n[i-1]) % 998244353;
		for (int i=1; i<300001; i++) powers_2[i] = (2*powers_2[i-1]) % 998244353;
		/*System.out.println("-----");
		for (int i=0; i<10; i++) System.out.println(r_of_n[i]);
		System.out.println("-----");
		for (int i=0; i<10; i++) System.out.println(e_of_n[i]);*/

		// Set up board
		n=stdin.nextInt(); m=stdin.nextInt();
		board = new boolean[n][m];
		for (int i=0; i<n; i++) board[i] = preprocessRow(stdin.next());
		for (boolean[] row : board)
			for (boolean tile : row) total_white += tile ? 1 : 0;
        System.out.println(solveBoard());
	}
	public static boolean[] preprocessRow(String row) {
		boolean[] processed = new boolean[row.length()];
		for (int i=0; i<row.length(); i++) processed[i] = row.charAt(i) == 'o';
		return processed;
	}
	public static long r(int x) {
		return r_of_n[x];
	}
	public static long solveRow(boolean[] row) {
		long res=0;
		int whiteString=0;
		for (boolean tile : row) {
			//System.out.print(tile ? 'W' : 'B');
			if (tile) whiteString++;
			else {
				res = (res + (r(whiteString)*powers_2[total_white-whiteString])%998244353)%998244353;
				whiteString=0;
			}
		}
		res = (res + (r(whiteString)*powers_2[total_white-whiteString])%998244353)%998244353;
		//System.out.println(" " + res);
		return res;
	}
	public static long solveBoard() {
        long res=0;
		for (boolean[] row : board) res = (res + solveRow(row))%998244353;
        for (int i=0; i<m; i++) {
            boolean[] column = new boolean[n];
            for (int f=0; f<n; f++) column[f] = board[f][i];
            res = (res + solveRow(column))%998244353;
        }

        return res;
	}
}