import java.io.*;
import java.util.*;


class Main {
	
	public boolean grid[][];
	public long gridcount[][];
	public int gridW;
	public int gridH;
	
	public static void main(String args[])
	{	
		Main obj = new Main();
		obj.runit();	
		
	}

	public void runit()
	{
		Scanner sc = new Scanner(System.in);
		int wolfcount = 0;
		int state = 0;
		int x = 0;
		int y = 0;
		do
		{
			switch	(state)
			{
				case 0:
					gridW = sc.nextInt();
					gridH = sc.nextInt();
					if ((gridW == 0) && (gridH == 0)) { state = 3; return;};
					grid = new boolean[gridW+1][gridH+1];
					gridcount = new long[gridW+1][gridH+1];
					//System.out.println("Size is: " + gridW + "  " + gridH);
					for (int i = 0; i < gridH; i++) for (int j = 0; j < gridW; j++) { grid[j][i] = false;};

					state = 1;
					break;

				case 1:
					wolfcount = sc.nextInt();
//					System.out.println("Wolfcount: " + wolfcount );
					state = 2;
					break;

				case 2:
					for (int i = 0; i < wolfcount; i++)
					{
						int wolfX = sc.nextInt();
						int wolfY = sc.nextInt();
						//System.out.println("Finding wolf at " + wolfX + "  " + wolfY);
						grid[wolfX][wolfY] = true;				
					};
					long pathcount = getPaths();
					if (pathcount > 1) System.out.println("There are " + pathcount + " paths from Little Red Riding Hood's house to her grandmother's house.");
					if (pathcount == 1) System.out.println("There is one path from Little Red Riding Hood's house to her grandmother's house.");
					if (pathcount == 0) System.out.println("There is no path.");					
					state = 0;
					break;	
				case 3: return;				
			} //end switch	
		} while (sc.hasNext());

	};

	public long getPaths()
	{
		int i,j;
		gridcount[gridW][gridH] = 1;
		for (j = gridH; j >=0; j--)
		{
			for (i = gridW; i >= 0; i--)
			{
				if (grid[i][j]) gridcount[i][j] = 0; //if there is a wolf
				else
				{
					if (i != gridW) //not along the edge...
					gridcount[i][j] += gridcount[i+1][j];
					if (j != gridH)
					gridcount[i][j] += gridcount[i][j+1];
				};
			};
		};
		return gridcount[0][0];
	};
};
