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:
//Praise our lord and saviour qlf9
//DecimalFormat f = new DecimalFormat("##.00");

import java.util.*;
import java.io.*;
import java.math.*;
import java.text.*;
public class E{
private static int mod =   998244353;
public static void main(String[] omkar) throws Exception
{
   BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
   StringTokenizer st = new StringTokenizer(in.readLine());
   StringBuilder sb = new StringBuilder();
   int n = Integer.parseInt(st.nextToken());
   int m = Integer.parseInt(st.nextToken());
   int[][] mat = new int[n][m];
   int[] tots;
   int[] whites = new int[m+1];
   int totalWhites = 0;
   long total = 0L;
   String a;
   for(int i = 0; i < n; i++)
   {
      a = in.readLine();
      for(int j = 0; j < m; j++)
      {
         if(a.charAt(j) == '*')
         {
            mat[i][j] = 1;
         }
         else
         {
            mat[i][j] = 0;
            totalWhites++;
         }
      }
   } 
   for(int i = 0; i < n; i++)
   {
   tots = new int[m+1];
   whites = new int[m+1];
   for(int j = 0; j < m; j++)
   {
      whites[j+1] = whites[j];
      if(mat[i][j] == 1)
      {
         tots[j+1] = tots[j];
      }
      else
      {
         if(j == 0)
         {
            whites[j+1]++;
         }
         else
         {
            whites[j+1]++;
            if(mat[i][j-1] == 1)
            {
               tots[j+1] = (int)((2L*(long)(tots[j]))%mod);  
            }
            else
            {
               tots[j+1] = (int)(((long)((2L*(long)(tots[j-1]))%mod)+(long)(tots[j])+(long)(exp(2, whites[j-1], mod)))%mod);
            }
         }
      }
   }
   total = (total + ((long)(tots[m])*(long)(exp(2, totalWhites-whites[m], mod)))%mod)%mod;
   }
   for(int i = 0; i < m; i++)
   {
   tots = new int[n+1];
   whites = new int[n+1];
   for(int j = 0; j < n; j++)
   {
      whites[j+1] = whites[j];
      if(mat[j][i] == 1)
      {
         tots[j+1] = tots[j];
      }
      else
      {
         if(j == 0)
         {
            whites[j+1]++;
         }
         else
         {
            whites[j+1]++;
            if(mat[j-1][i] == 1)
            {
               tots[j+1] = (int)((2L*(long)(tots[j]))%mod);  
            }
            else
            {
               tots[j+1] = (int)(((long)((2L*(long)(tots[j-1]))%mod)+(long)(tots[j])+(long)(exp(2, whites[j-1], mod)))%mod);
            }
         }
      }
   }
   total = (total + ((long)(tots[n])*(long)(exp(2, totalWhites-whites[n], mod)))%mod)%mod;
   }
   System.out.println(total);
        }
 public static void solve(BufferedReader in, StringTokenizer st, StringBuilder sb) throws Exception
 {
  
 }
  public static int exp(int a, int exp, int mod)
{
   int e = exp;
   if(e==0)
   {
      return 1;
   }
   long b = (long)(a);
   long ret = 1;
   while(e > 1)
   {
      if(e % 2 == 0)
      {
         e = e/2;
         b = (b*b)%mod;
      }
      else
      {
         ret = (ret*b)%mod;
         e = e/2;
         b = (b*b)%mod;
      }
   }
   b = (b*ret)%mod;
   return (int)(b);
}

 public static int[] readArr(int N, BufferedReader in, StringTokenizer st) throws Exception
      {
         int[] arr = new int[N];
         st = new StringTokenizer(in.readLine());
         for(int i=0; i < N; i++)
            arr[i] = Integer.parseInt(st.nextToken());
         return arr;
      }


}