#include <bits/stdc++.h>
using namespace std;
const int MOD(1000000007);
const int INF((1 << 30) - 1);
const int MAXN(305);
struct bar {
  int x1, y1, x2, y2;
  bar(int k1, int k2, int k3, int k4) {
    x1 = k1;
    y1 = k2;
    x2 = k3;
    y2 = k4;
  }
};
vector<bar> a, b;
bool isbreak[MAXN], used[MAXN];
bool canbreak(int i, int j) {
  if (b[i].x1 == a[j].x1 && b[i].x2 == a[j].x2 && a[j].y1 <= b[i].y1 &&
      b[i].y2 <= a[j].y2) {
    a.push_back(bar(a[j].x1, a[j].y1, b[i].x2, b[i].y2));
    a.push_back(bar(b[i].x1, b[i].y1, a[j].x2, a[j].y2));
    return true;
  }
  if (b[i].y1 == a[j].y1 && b[i].y2 == a[j].y2 && a[j].x1 <= b[i].x1 &&
      b[i].x2 <= a[j].x2) {
    a.push_back(bar(a[j].x1, a[j].y1, b[i].x2, b[i].y2));
    a.push_back(bar(b[i].x1, b[i].y1, a[j].x2, a[j].y2));
    return true;
  }
  return false;
}
int main() {
  int w, h, n;
  scanf("%d%d%d", &w, &h, &n);
  a.push_back(bar(0, 0, w, h));
  for (int i = 0; i < n; i++) {
    int x1, y1, x2, y2;
    scanf("%d%d%d%d", &x1, &y1, &x2, &y2);
    b.push_back(bar(x1, y1, x2, y2));
  }
  for (int k = 0; k < n; k++) {
    for (int i = 0; i < n; i++) {
      if (used[i]) continue;
      for (int j = 0; j < a.size(); j++) {
        if (isbreak[j]) continue;
        if (canbreak(i, j)) {
          used[i] = true;
          isbreak[j] = true;
          break;
        }
      }
      if (used[i]) break;
    }
  }
  vector<int> area;
  for (int i = 0; i < a.size(); i++) {
    if (isbreak[i]) continue;
    area.push_back((a[i].x2 - a[i].x1) * (a[i].y2 - a[i].y1));
  }
  sort(area.begin(), area.end());
  for (int i = 0; i < area.size(); i++) printf("%d ", area[i]);
}
