import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		long[][] map = new long[102][102];
		Scanner in = new Scanner(System.in);
		
		while (true) {
			int w = in.nextInt(), h = in.nextInt();
			if (w == 0) break;
			for (int i = 0 ; i <= w + 1; i++)
				for (int j = 0; j <= h + 1; j++)
					map[i][j] = 0;
			int num_wolf = in.nextInt();
			for (int i = 0; i < num_wolf; i++) {
				int x = in.nextInt(), y = in.nextInt();
				map[x][y] = -1;
			}
			
			map[w][h] = 1;
			
			for (int i = w; i >= 0; i--)
				for (int j = h; j >= 0; j--) {
					if (map[i][j] >= 0) map[i][j] += map[i][j + 1] + map[i + 1][j];
					else map[i][j] = 0;
				}			
			
			if (map[0][0] == 0) System.out.println("There is no path.");
			else if (map[0][0] == 1) System.out.println("There is one path from Little Red Riding Hood's house to her grandmother's house.");
			else System.out.println("There are " + map[0][0] + " paths from Little Red Riding Hood's house to her grandmother's house.");
		}		
	}
}
