#include <bits/stdc++.h>
using namespace std;
int w, h, n, x[100], y[100], x2[100], y2[100], a[99][100], b[100][99],
    aux = 0, area[101], ret[100][100];
void read() {
  scanf("%d %d %d", &w, &h, &n);
  for (int(i) = (0); (i) < (n); (i)++)
    scanf("%d %d %d %d", &x[i], &y[i], &x2[i], &y2[i]);
}
void process() {
  memset(a, 0, sizeof(a));
  memset(b, 0, sizeof(b));
  for (int(i) = (0); (i) < (n); (i)++) {
    if (x[i] == x2[i])
      for (int(j) = (y[i]); (j) < (y2[i]); (j)++) b[j][x[i] - 1] = 1;
    else
      for (int(j) = (x[i]); (j) < (x2[i]); (j)++) a[y[i] - 1][j] = 1;
  }
  aux = 0;
  ret[0][0] = aux;
  for (int(i) = (0); (i) < (w); (i)++)
    for (int(j) = (0); (j) < (h); (j)++) {
      ret[i][j] = -1;
      if (j > 0 && !a[j - 1][i]) ret[i][j] = ret[i][j - 1];
      if (i > 0 && !b[j][i - 1]) ret[i][j] = ret[i - 1][j];
      if (ret[i][j] == -1) {
        aux++;
        ret[i][j] = aux;
      }
    }
  for (int(i) = (0); (i) < (w); (i)++)
    for (int(j) = (0); (j) < (h); (j)++) area[ret[i][j] - 1]++;
  sort(area, area + n + 1);
  for (int(i) = (0); (i) < (n + 1); (i)++) printf("%d ", area[i]);
}
int main() {
  read();
  process();
  return 0;
}
