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 CPP):

Solution:
#include<bits/stdc++.h>
using namespace std;

struct _field
{
    bool white = false;
};


int mod = 998244353;


int main()
{
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
#ifndef ONLINE_JUDGE
    freopen("input.txt", "r", stdin);
    //freopen("a.out","w",stdout); // console output is better (in most cases)
#else
    // add i/o method of specific testing system
#endif

    int n, m;
    cin >> n >> m;
    vector<vector<_field>> field(m + 1, vector<_field>(n + 1));
    for(int y = 1; y <= n; ++y)
    {
        for(int x = 1; x <= m; ++x)
        {
            char temp;
            cin >> temp;
            if(temp == '*')
            {
                field[x][y].white = false;
            }
            if(temp == 'o')
            {
                field[x][y].white = true;
            }
        }
    }
    long long sol = 0; // value
    long long v = 0; // value
    long long h = 0; // combinations that have a half to the left
    long long e = 0; // combinations that are ended on the left
    long long c = 1; // #combinations
    for(int y = 0; y <= n; ++y)
    {
        for(int x = 0; x <= m; ++x)
        {
            long long nh = 0;
            long long ne = 0;
            // count if we match the color
            nh = (c + e) % mod;
            ne = h;


            c = ((c + e) % mod + h) % mod;
            if(field[x][y].white)
            {
                v = ((v * 2) % mod + ne) % mod;
            }
            else
            {
                nh = 0;
                ne = 0;
            }

            h = nh;
            e = ne;

        }
    }
    sol = v;
    int sol1 = v;
    v = 0;
    h = 0; // combinations that have a half to the left
    e = 0; // combinations that are ended on the left
    c = 1; // black ones
    for(int x = 0; x <= m; ++x)
    {
        for(int y = 0; y <= n; ++y)
        {
            long long nh = 0;
            long long ne = 0;
            // count if we match the color
            nh = (c + e) % mod;
            ne = h;


            c = ((c + e) % mod + h) % mod;
            if(field[x][y].white)
            {
                v = ((v * 2) % mod + ne) % mod;
            }
            else
            {
                nh = 0;
                ne = 0;
            }

            h = nh;
            e = ne;

        }
    }
    int sol2 = v;

    sol = (sol + v) % mod;
    //cout << sol1 << "\n";
    //cout << sol2 << "\n";
    cout << sol << "\n";

    return 0;
}