// Arup Guha
// 4/6/2024
// Solution to Kattis Problem: Robots on a Grid
// https://open.kattis.com/problems/robotsonagrid

import java.util.*;

public class robotsonagrid {

	final public static int[] DX = {-1,0,0,1};
	final public static int[] DY = {0,-1,1,0};

	public static long MOD = (1L<<31)-1;
	
	public static void main(String[] args) {
	
		// Read in the grid.
		Scanner stdin = new Scanner(System.in);
		int n = stdin.nextInt();
		char[][] grid = new char[n][];
		for (int i=0; i<n; i++)
			grid[i] = stdin.next().toCharArray();
		
		// Check if anyway.
		if (!canDo(grid))
			System.out.println("INCONCEIVABLE");
			
		// Do DP here and check if possible going R and D.
		else {
		
			long[][] dp = new long[n][n];
			boolean[][] reach = new boolean[n][n];
			
			// Initialize first row.
			int cur = 1;
			for (int i=0; i<n; i++) {
				if (grid[0][i] == '#') cur = 0;
				dp[0][i] = cur;
				reach[0][i] = (cur == 1);
			}
			
			// Initialize first column
			cur = 1;
			for (int i=0; i<n; i++) {
				if (grid[i][0] == '#') cur = 0;
				dp[i][0] = cur;
				reach[i][0] = (cur == 1);
			}
			
			// Go to all squares.
			for (int i=1; i<n; i++) {
				for (int j=1; j<n; j++) {
				
					// Can't make it.
					if (grid[i][j] == '#') {
						dp[i][j] = 0;
						reach[i][j] = false;
					}
					
					// Add from above and left.
					else {
						dp[i][j] = (dp[i-1][j] + dp[i][j-1])%MOD;
						reach[i][j] = reach[i-1][j] || reach[i][j-1];
					}
				}
			}
			
			// Can't make it.
			if (!reach[n-1][n-1])
				System.out.println("THE GAME IS A LIE");
				
			// Print # of ways.
			else
				System.out.println(dp[n-1][n-1]);
		}
	}
	
	// Returns true iff we can reach from the top left to the bottom right by moving
	// up, down, left and right.
	public static boolean canDo(char[][] grid) {
	
		// Set up BFS.
		int n = grid.length;
		ArrayDeque<Integer> q = new ArrayDeque<Integer>();
		q.offer(0);
		boolean[][] reach = new boolean[n][n];
		reach[0][0] = true;
		
		while (q.size() > 0) {
		
			// Remove this item.
			int cur = q.poll();
			int cX = cur/n;
			int cY = cur%n;
			
			// Try all 4 places to go.
			for (int i=0; i<DX.length; i++) {
				int nX = cX + DX[i];
				int nY = cY + DY[i];
				
				// Out of bounds.
				if (nX<0 || nX>=n || nY<0 || nY>=n) continue;
			
				// Been there before.
				if (reach[nX][nY]) continue;
				
				// Illegal square.
				if (grid[nX][nY] == '#') continue;
				
				// Mark and add to queue.
				reach[nX][nY] = true;
				q.offer(nX*n+nY);
			}
		}
		
		// If we can get there or not.
		return reach[n-1][n-1];
	}
}