#include <iostream>
#include <cmath>
#include <vector>
#include <algorithm>
#include <fstream>

using namespace std;

int main() {

  ifstream fin("torta.in");
  ofstream fout("torta.out");

  int n; fin >> n;
  vector<double> angle;
  for (int i=0; i<n; ++i) {
    double x1, y1, x2, y2;
    fin >> x1 >> y1 >> x2 >> y2;
    angle.push_back(atan2(x1-x2, y1-y2));
  }
  
  sort(angle.begin(), angle.end());
  long long tot = 1, curr = 1;
  long long longN=n;
  tot+= longN*(longN+1)/2;
  for (int i=1; i<n; ++i, ++curr)
    if (angle[i] - angle[i-1] > 1.0e-6) {
      tot-=curr*(curr-1)/2;
      curr = 0;
    } 
  tot-=curr*(curr-1)/2;
  tot %= 1000003;

  fout << tot << endl;

  fin.close(); fout.close();

}
