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:
// Main Code at the Bottom
import java.util.*;
import java.io.*; 
public class Main{
	//Fast IO class
    static class FastReader {
        BufferedReader br; 
        StringTokenizer st; 
        public FastReader() {
        	boolean env=System.getProperty("ONLINE_JUDGE") != null;
        	//env=true;
        	if(!env) {
        		try {
					br=new BufferedReader(new FileReader("src\\input.txt"));
				} catch (FileNotFoundException e) {
					e.printStackTrace();
				}
        	}
        	else br = new BufferedReader(new InputStreamReader(System.in)); 
        } 
        String next() {
            while (st == null || !st.hasMoreElements()) {
                try {
                    st = new StringTokenizer(br.readLine()); 
                } 
                catch (IOException  e) {
                    e.printStackTrace(); 
                } 
            } 
            return st.nextToken(); 
        } 
        int nextInt() {
            return Integer.parseInt(next()); 
        } 
        long nextLong() {
            return Long.parseLong(next()); 
        } 
        double nextDouble() {
            return Double.parseDouble(next()); 
        } 
        String nextLine() {
            String str = ""; 
            try {
                str = br.readLine(); 
            } 
            catch (IOException e) {
                e.printStackTrace(); 
            } 
            return str; 
        } 
    }     
    static long MOD=(long)1e9+7;
    //debug
    static void debug(Object... o) {
        System.out.println(Arrays.deepToString(o));
    }
    static FastReader sc=new FastReader();
    static PrintWriter out=new PrintWriter(System.out);  
    //Global variables and functions
    static long fastExpo(long a, long b) {
    	if(b == 0) return 1;
    	if(b % 2 == 0) return fastExpo((a * a) % MOD, b / 2) % MOD;
    	return (a * (fastExpo((a * a) % MOD, b / 2) % MOD))%MOD;
    }
    static long find(long n) {
    	long v1 = fastExpo(2,n);
    	v1 = (((3*n+1)%MOD)*v1)%MOD;
    	if(n%2==0) v1 = (v1 - 1+MOD)%MOD;
    	else v1 = (v1 + 1)%MOD;
    	long v2 = (v1*fastExpo(9,MOD-2))%MOD;
    	return v2;
    }
    static long solve(char a[][], int n, int m) {
    	long ans = 0, o = 0;
    	for(int i=0;i<n;i++) {
    		for(int j=0;j<m;j++) {
    			o+=(a[i][j]=='o'?1:0);
    		}
    	}
    	for(int i = 0; i < n ; i++) {
    		for(int j = 0; j < m; j++) {
    			if(a[i][j]!='o') continue;
    			int k=j;
    			while(k<m && a[i][k]=='o') k++;
    			int N=k-j;
    			ans=(ans + find(N-1)*fastExpo(2,o-N))%MOD;
    			j=k;
    		}
    	}
    	return ans;
    }
    static char[][] transpose(char a[][], int n,int m) {
    	char tmp[][] = new char[m][n];
    	for(int i=0;i<n;i++) {
    		for(int j=0;j<m;j++) {
    			tmp[j][i]=a[i][j];
    		}
    	}
    	return tmp;
    }
    //Main function(The main code starts from here)
    public static void main (String[] args) throws java.lang.Exception {
    	int test=1;
    	//test=sc.nextInt();
    	while(test-->0) {
    		MOD = 998244353;
    		int n = sc.nextInt(), m = sc.nextInt();
    		char s[][] = new char[n][m];
    		for(int i = 0; i < n; i++) {
    			s[i] = sc.nextLine().toCharArray();
    		}
    		long val=(solve(s,n,m)+solve(transpose(s,n,m),m,n))%MOD;
    		out.println(val);
    	}
        out.flush();
        out.close();
    }
}