Problem: We have an H \times W grid, where each square is painted white or black in the initial state. Given are strings A_1, A_2, ..., A_H representing the colors of the squares in the initial state. For each pair (i, j) (1 \leq i \leq H, 1 \leq j \leq W), if the j-th character of A_i is `.`, the square at the i-th row and j-th column is painted white; if that character is `#`, that square is painted black.

Among the 2^{HW} ways for each square in the grid to be painted white or black, how many can be obtained from the initial state by performing the operations below any number of times (possibly zero) in any order? Find this count modulo 998,244,353.

* Choose one row, then paint all the squares in that row white.
* Choose one row, then paint all the squares in that row black.
* Choose one column, then paint all the squares in that column white.
* Choose one column, then paint all the squares in that column black.

Constraints

* 1 \leq H, W \leq 10
* |A_i| = W (1 \leq i \leq H)
* All strings A_i consist of `.` and `#`.
* H and W are integers.

Input

Input is given from Standard Input in the following format:


H W
A_1
A_2
\vdots
A_H


Output

Print the answer.

Examples

Input

2 2
#.
.#


Output

15


Input

2 2
.
.#


Output

15


Input

3 3
...
...
...


Output

230


Input

2 4
...
...#


Output

150


Input

6 7
.......
.......
.#.....
..#....
.#.#...
.......


Output

203949910

Solution (in CPP):

Solution:
#include<bits/stdc++.h>
#define rep(i,a,b) for(int i=(a);i<=(b);i++)
#define REP(i,n) for(int i=(0);i<(n);i++)
using namespace std;
typedef long long ll;

namespace{
	const int mod=998244353;
	int fix(int x){
		return x>=mod?x-mod:x;
	}
	template<class... T> int fix(int x,T... y){ 
		return (ll)x*fix(y...)%mod;
	}
	void add(int &x,int y){
		x=(x+y>=mod?x+y-mod:x+y);
	}
}

const int N=12;
int C[N][N],pw[N],f[2][N][N],r[N],c[N],n,m,ans;
char s[N];

void init(int n){
	C[0][0]=1,pw[0]=1;
	rep(i,1,n){
		C[i][0]=1,pw[i]=fix(pw[i-1],2);
		rep(j,1,i) C[i][j]=fix(C[i-1][j-1]+C[i-1][j]);
	}
	REP(t,2){
		rep(i,0,n) rep(j,0,n)
			if(!i||!j) f[t][i][j]=(t?pw[i+j]:1);
		rep(i,1,n) rep(j,1,n){
			rep(k,1,i) add(f[t][i][j],
				fix(k&1?1:mod-1,C[i][k],pw[k],f[t][i-k][j]));
			rep(k,1,j) add(f[t][i][j],
				fix(k&1?1:mod-1,C[j][k],pw[k],f[t][i][j-k]));
			rep(k,1,i) rep(l,1,j) add(f[t][i][j],
				fix((k+l)&1?2:mod-2,C[i][k],C[j][l],f[t][i-k][j-l]));
		}
	}
}

int main(){
	init(10),cin>>n>>m;
	rep(i,1,n){
		scanf("%s",s+1);
		rep(j,1,m) if(s[j]=='#')
			r[i-1]|=1<<(j-1),c[j-1]|=1<<(i-1);
	}
	rep(s,1,(1<<n)-1)
		rep(t,1,(1<<m)-1){
			int flag=0,a=0,b=0;
			REP(i,n) if(s>>i&1) a++,
				flag|=(r[i]&t)==t||((~r[i])&t)==t;
			REP(i,m) if(t>>i&1) b++,
				flag|=(c[i]&s)==s||((~c[i])&s)==s;
			if(!flag) add(ans,f[1][n-a][m-b]);
		}
	cout<<fix(ans+f[0][n][m])<<endl;
	return 0;
}