#!/usr/bin/perl
use strict;
use warnings;

my $W = (@ARGV ? shift @ARGV : 1 + int(rand(1000000)));
my $N = (@ARGV ? shift @ARGV : 1 + int(rand(1000)));

print "$W $N\n";
foreach (1 .. $N) {
	printf("%d %d\n", 1+int(rand($W)), 1+int(rand(1000)));
}
