/*--------------------------------------------------------------*/
/* ACM ICPC 2009-2010, NEERC                                    */
/* Northern Subregional Contest                                 */
/* St Petersburg, October 17, 2009                              */
/*--------------------------------------------------------------*/
/* Problem C. Circles on a Screen                               */
/*                                                              */
/* Original idea         Georgiy Korneev                        */
/* Problem statement     Oleg Davydov                           */
/* Testset               Oleg Davydov                           */
/*--------------------------------------------------------------*/
/* Solution                                                     */
/*                                                              */
/* Author                Georgiy Korneev                        */
/*--------------------------------------------------------------*/
 
import java.util.*;
import java.io.*;

public class circles_gk implements Runnable {
    static Scanner in;
    static PrintWriter out;

    private static class Segment implements Comparable<Segment> {
        final long min;
        final long max;

        public Segment(long min, long max) {
            this.min = min;
            this.max = max;
        }

        public int compareTo(Segment that) {
            return (int) (this.min - that.min);
        }
    }

    long sqrt(long x) {
        long r = Math.round(Math.sqrt(x));
        return (r * r <= x) ? r : r - 1;
    }

    public void run() {
        long w = in.nextInt();
        long h = in.nextInt();
        int n = in.nextInt();

        long[] x = new long[n];
        long[] y = new long[n];
        long[] r = new long[n];

        for (int i = 0; i < n; i++) {
            x[i] = in.nextInt();
            y[i] = in.nextInt();
            r[i] = in.nextInt();
        }

        long area = 0;
        for (int c = 0; c < w; c++) {
            List<Segment> segments = new ArrayList<Segment>();
            for (int i = 0; i < n; i++) {
                long d = r[i] * r[i] - (c - x[i]) * (c - x[i]);
                if (d >= 0) {
                    long z = sqrt(d);
                    segments.add(new Segment(Math.max(0, y[i] - z), Math.min(y[i] + z, h - 1)));
                }
            }
            Collections.sort(segments);
            long last = -1;
            long a = 0;
            for (Segment segment : segments) {
                //System.out.print("[" + segment.min + ", " + segment.max + "] ");
                if (last < segment.min) {
                    last = segment.min - 1;
                }
                if (segment.max >= last) {
                    //System.out.print(segment.max - last + " ");
                    a += segment.max - last;
                }
                last = Math.max(last, segment.max);
            }
            area += a;
            System.out.println(a);
        }

        out.println(w * h - area);
    }

    public static void main(String[] args) throws Exception {        
        in = new Scanner(System.in);
        out = new PrintWriter(System.out);

        new circles_gk().run();

        in.close();
        out.close();
    }
}
