#include <bits/stdc++.h>
using namespace std;
int main() {
  bool tab[300][300];
  memset(tab, 0, sizeof tab);
  int h, w, n;
  cin >> w >> h >> n;
  for (int i = 0; i < 300; i++) tab[2 * w][i] = 1;
  for (int i = 0; i < 300; i++) tab[i][2 * h] = 1;
  for (int i = 0; i < 300; i++) tab[0][i] = 1;
  for (int i = 0; i < 300; i++) tab[i][0] = 1;
  int x1, x2, y1, y2;
  for (int k = 0; k < n; k++) {
    cin >> x1 >> y1 >> x2 >> y2;
    if (x1 == x2) {
      for (int i = 2 * y1 + 1; i < 2 * y2 + 1; i++) {
        tab[2 * x1][i] = 1;
      }
    } else {
      for (int i = 2 * x1 + 1; i < 2 * x2 + 1; i++) {
        tab[i][2 * y1] = 1;
      }
    }
  }
  vector<int> v;
  for (int i = 0; i < w; i++) {
    for (int j = 0; j < h; j++) {
      if (tab[2 * i + 1][2 * j + 1] == 1) continue;
      int i_ = i + 1, j_ = j + 1;
      while (!tab[2 * i + 1][2 * j_]) j_++;
      while (!tab[2 * i_][2 * j + 1]) i_++;
      v.push_back((j_ - j) * (i_ - i));
      for (int a = i; a < i_; a++) {
        for (int b = j; b < j_; b++) {
          tab[2 * a + 1][2 * b + 1] = 1;
        }
      }
    }
  }
  sort(v.begin(), v.end());
  for (int i = 0; i < v.size(); i++) {
    if (i) cout << " ";
    cout << v[i];
  }
  return 0;
}
