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 tmp {
    final int mod=998244353;
    String[] a;
    int n,m;
    long tb[];
    int ck(int x,int y){
        int res=0;
        if(x-1>=0&&a[x-1].charAt(y)=='o')res++;
        if(x+1<n&&a[x+1].charAt(y)=='o')res++;
        if(y-1>=0&&a[x].charAt(y-1)=='o')res++;
        if(y+1<m&&a[x].charAt(y+1)=='o')res++;
        return res;
    }
    long qpow(long a,long b){
        if(b<0)return 0l;
        long res = 1; 
        a %= mod; 
        for (; b>=0; b >>= 1) { 
            if (b%2==1)res = res * a % mod; 
            a = a * a % mod; 
        }
        return res;
    }
    long solver(long x,long s){
        long res=0,k=1;
        for(long i=1;i<x;i++){
            res+=(mod+k*(x-i))%mod*tb[(int)s-(int)i-1]%mod;
            res%=mod;
            k=-k;
        }
        return res;
    }    
    void solve(){
        Scanner rd=new Scanner(System.in);
        
        n=rd.nextInt();
        m=rd.nextInt();
        int N=300005;
        a=new String[N];
        tb=new long[N];
        for(int i =0;i<n;i++){
            a[i]=rd.next();
        }
        tb[0]=1;
        for(int i=1;i<=N-2;i++)tb[i]=tb[i-1]*2%mod;
        long tot=0,s=0;
        for(int i=0;i<n;i++){
            for(int j=0;j<m;j++){
                if(a[i].charAt(j)=='o'){
                    tot+=ck(i,j);s++;
                }
            }
        }
        long ans=0;
        rd.close();
        for(int i=0;i<n;i++){
            long q=0;
            for(int j=0;j<m;j++){
                if(a[i].charAt(j)=='o'){
                    q++;
                }
                else{
                    if(q>=2){
                        ans+=solver(q,s);
                        ans%=mod;
                    }
                    q=0;
                }
            }
            if(q>=2){
                ans+=solver(q,s);
                ans%=mod;
            }
        }
        
        for(int j=0;j<m;j++){
            long q=0;
            for(int i=0;i<n;i++){
                if(a[i].charAt(j)=='o'){
                    q++;
                }
                else{
                    if(q>=2){
                        ans+=solver(q,s);
                        ans%=mod;
                    }
                    q=0;
                }
            }
            if(q>=2){
                ans+=solver(q,s);
                ans%=mod;
            }
        }
        System.out.println(ans);
        
    }
    public static void main(String[]args){
        tmp cs=new tmp();
        cs.solve();
    }
}