public void process(int u, int v) {
    int a = hash(u);
    int b = hash(v);
    for (int i = 0; i < p-1; i ++) {
      for (int j = i+1; j < p; j ++) {
        // if {a,b} belongs to {i,j}
        // emit <(i,j), (u,v)>
      }
    }

    if (a != b) {
      for (int i = 0; i < p-2; i ++) {
        for (int j = i+1; j < p-1; j ++) {
          for (int k = j+1; k < p; k ++) {
            // if {a,b} belongs to {i,j,k}
            // emit <(i,j,k),(u,v)>
          }
        }
      }
    }
  }