// Arup Guha
// 4/15/2014
// Solution to 2004 UCF High School Contest Problem: Hug

import java.util.*;

public class hug {

    public static void main(String[] args) {
    	
    	Scanner stdin = new Scanner(System.in);
    	
    	int w = stdin.nextInt();
    	int h = stdin.nextInt();
    	
    	// Go through each case.
    	while (w != 0) {
    		
    		// Read in y vals and radii.
    		int n = stdin.nextInt();
    		int[][] circles = new int[n][2];
    		for (int i=0; i<n; i++) {
    			stdin.nextInt();
    			circles[i][0] = stdin.nextInt();
    			circles[i][1] = stdin.nextInt();
    		}
    		
    		int best = 0;
    		
    		// Try walking each "important" line, horizontally tangent to each circle.
    		for (int i=0; i<n; i++) {
    			
    			// This is walking the low line.
    			int cur = 0;
    			for (int j=0; j<n; j++)
    				if (Math.abs(circles[i][0]-circles[i][1]-circles[j][0]) <= circles[j][1])
    					cur++;
    					
    			// Update if necessary.
    			if (cur > best) best = cur;
    			
       			// This is walking the high line.
    			cur = 0;
    			for (int j=0; j<n; j++)
    				if (Math.abs(circles[i][0]+circles[i][1]-circles[j][0]) <= circles[j][1])
    					cur++;
    			if (cur > best) best = cur; 			
    		}
    		
    		// Output result.
    		System.out.println("Ali can get "+best+" hug(s)!");
    		
    		// Go to next case.
    		w = stdin.nextInt();
    		h = stdin.nextInt();
    	}
    }
}