#
#   Generate a bad case; city 1 -> city 1: tons of flights;
#   city 1 -> city 2 one flight at the end.
#
my $n = 2 ;
my $m = shift ;
print "$n $m\n" ;
for ($i=0; $i+1<$m; $i++) {
   my $bt = int rand 1e6 ;
   my $et = int rand 1e6 ;
   if ($bt > $et) {
      ($bt, $et) = ($et, $bt) ;
   }
   print "1 1 $bt $et\n" ;
}
for (; $i<$m; $i++) {
   my $bt = 2e6 + int rand 1e6 ;
   my $et = 2e6 + int rand 1e6 ;
   if ($bt > $et) {
      ($bt, $et) = ($et, $bt) ;
   }
   print "1 2 $bt $et\n" ;
}
