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.util.Map.Entry;

import java.math.*;
import java.io.*;

public class Main {
	final static int mod = 998244353;

	public static void main(String[] args) throws FileNotFoundException {
		InputReader in = new InputReader(System.in);
		// Scanner in = new Scanner(System.in);
		// Scanner in = new Scanner(new BufferedReader(new
		// InputStreamReader(System.in)));
		PrintWriter out = new PrintWriter(System.out);
		// InputReader in = new InputReader(new
		// File("ethan_traverses_a_tree.txt"));
		// PrintWriter out = new PrintWriter(new
		// File("ethan_traverses_a_tree-output.txt"));

		int n = in.nextInt();
		int m = in.nextInt();

		int countwhite = 0;
		int[][] a = new int[n][m];
		for (int i = 0; i < n; i++) {
			char[] tmp = in.next().toCharArray();
			for (int j = 0; j < m; j++) {
				if (tmp[j] == '*') {
					a[i][j] = 0;
				} else {
					a[i][j] = 1;
					countwhite++;
				}
			}
		}

		int[][] toup = new int[n][m];
		int[][] toleft = new int[n][m];
		for (int i = 0; i < n; i++) {
			for (int j = 0; j < m; j++) {
				if (a[i][j] == 0) {
					toup[i][j] = -1;
					toleft[i][j] = -1;
				} else {
					if (i > 0) {
						toup[i][j] = toup[i - 1][j] + 1;
					} else {
						toup[i][j] = 0;
					}

					if (j > 0) {
						toleft[i][j] = toleft[i][j - 1] + 1;
					} else {
						toleft[i][j] = 0;
					}
				}
			}
		}

		long[] pow2 = new long[countwhite + 1];
		pow2[0] = 1;
		for (int i = 1; i <= countwhite; i++) {
			pow2[i] = (pow2[i - 1] * 2) % mod;
		}

		long[] dp = new long[countwhite + 1];
		for (int i = 0; i <= countwhite; i++) {
			if (i == 0 || i == 1) {
				dp[i] = 1;
			} else {
				dp[i] = (pow2[i - 1] + dp[i - 2]) % mod;
			}
		}

		long ans = 0;
		for (int i = 0; i < n; i++) {
			for (int j = 0; j < m; j++) {
				if (a[i][j] == 1) {
					if (i < n - 1 && a[i + 1][j] == 1) {
						int upcount = toup[i][j];
						ans = (ans + pow2[countwhite - upcount - 2] * dp[upcount]) % mod;
					}
					if (j < m - 1 && a[i][j + 1] == 1) {
						int leftcount = toleft[i][j];
						ans = (ans + pow2[countwhite - leftcount - 2] * dp[leftcount]) % mod;
					}
				}
			}
		}

		out.printf("%d\n", ans);

		out.close();
	}

	static class InputReader {
		BufferedReader br;
		StringTokenizer st;

		public InputReader(File f) {
			try {
				br = new BufferedReader(new FileReader(f));
			} catch (FileNotFoundException e) {
				e.printStackTrace();
			}
		}

		public InputReader(InputStream in) {
			br = new BufferedReader(new InputStreamReader(in));
		}

		public String next() {
			while (st == null || !st.hasMoreTokens()) {
				try {
					st = new StringTokenizer(br.readLine());
				} catch (IOException e) {
					e.printStackTrace();
				}
			}
			return st.nextToken();
		}

		public boolean hasNext() {
			while (st == null || !st.hasMoreTokens()) {
				String s = null;
				try {
					s = br.readLine();
				} catch (IOException e) {
					e.printStackTrace();
				}
				if (s == null)
					return false;
				st = new StringTokenizer(s);
			}
			return true;
		}

		public int nextInt() {
			return Integer.parseInt(next());
		}

		public long nextLong() {
			return Long.parseLong(next());
		}

		public double nextDouble() {
			return Double.parseDouble(next());
		}
	}
}