Language: C++

var
  n,m,i,j,zrt:longint;
  p,y,a,b,c,o:array[0..1000000]of longint;
Procedure ch(var x,y:longint);
var
  t:longint;
begin
  t:=x;x:=y;y:=t;
end;
Procedure qs(l,r:longint);
var
  i,j,mid1,mid2:longint;
begin
  i:=l;j:=r;mid1:=p[(l+r)div 2];mid2:=y[(l+r)div 2];
  repeat
    while (p[i]<mid1)or((p[i]=mid1)and(y[i]<mid2)) do inc(i);
    while (p[j]>mid1)or((p[j]=mid1)and(y[j]>mid2)) do dec(j);
    if i<=j then
      begin
        ch(p[i],p[j]);
        ch(y[i],y[j]);
        ch(c[i],c[j]);
        inc(i);dec(j);
      end;
  until i>j;
  if l<j then qs(l,j);
  if i<r then qs(i,r);
end;


begin
  readln(n,m);
  for i:=1 to m do
    begin
      readln(p[i],y[i]);
      a[i]:=p[i];c[i]:=i;
    end;
  qs(1,m);
  for i:=1 to m do
    begin
      if (i=1)or(p[i]<>p[i-1]) then j:=1 else inc(j);
      o[c[i]]:=j;
    end;
  for i:=1 to m do
    begin
      zrt:=100000;
      for j:=1 to 6 do
        begin
          if a[i]<zrt then
            begin
              zrt:=zrt div 10;
              write(0);
            end else
          break;
       end;
      write(a[i]);
      zrt:=100000;
      for j:=1 to 6 do
        begin
          if o[i]<zrt then
            begin
              zrt:=zrt div 10;
              write(0);
            end else
          break;
        end;
      writeln(o[i]);
  end;
      end.


Compiler output:
a.cc:3:21: error: too many decimal points in number
    3 |   p,y,a,b,c,o:array[0..1000000]of longint;
      |                     ^~~~~~~~~~
a.cc:1:1: error: 'var' does not name a type
    1 | var
      | ^~~
a.cc:3:3: error: 'p' does not name a type
    3 |   p,y,a,b,c,o:array[0..1000000]of longint;
      |   ^
a.cc:4:1: error: 'Procedure' does not name a type
    4 | Procedure ch(var x,y:longint);
      | ^~~~~~~~~
a.cc:5:1: error: 'var' does not name a type
    5 | var
      | ^~~
a.cc:7:1: error: 'begin' does not name a type
    7 | begin
      | ^~~~~
a.cc:8:8: error: 'x' does not name a type
    8 |   t:=x;x:=y;y:=t;
      |        ^
a.cc:8:13: error: 'y' does not name a type
    8 |   t:=x;x:=y;y:=t;
      |             ^
a.cc:9:1: error: 'end' does not name a type
    9 | end;
      | ^~~
a.cc:10:1: error: 'Procedure' does not name a type
   10 | Procedure qs(l,r:longint);
      | ^~~~~~~~~
a.cc:11:1: error: 'var' does not name a type
   11 | var
      | ^~~
a.cc:13:1: error: 'begin' does not name a type
   13 | begin
      | ^~~~~
a.cc:14:8: error: 'j' does not name a type
   14 |   i:=l;j:=r;mid1:=p[(l+r)div 2];mid2:=y[(l+r)div 2];
      |        ^
a.cc:14:13: error: 'mid1' does not name a type
   14 |   i:=l;j:=r;mid1:=p[(l+r)div 2];mid2:=y[(l+r)div 2];
      |             ^~~~
a.cc:14:33: error: 'mid2' does not name a type
   14 |   i:=l;j:=r;mid1:=p[(l+r)div 2];mid2:=y[(l+r)div 2];
      |                                 ^~~~
a.cc:15:3: error: 'repeat' does not name a type
   15 |   repeat
      |   ^~~~~~
a.cc:17:5: error: expected unqualified-id before 'while'
   17 |     while (p[j]>mid1)or((p[j]=mid1)and(y[j]>mid2)) do dec(j);
      |     ^~~~~
a.cc:18:5: error: expected unqualified-id before 'if'
   18 |     if i<=j then
      |     ^~
a.cc:21:11: error: expected constructor, destructor, or type conversion before '(' token
   21 |         ch(y[i],y[j]);
      |           ^
a.cc:22:11: error: expected constructor, destructor, or type conversion before '(' token
   22 |         ch(c[i],c[j]);
      |           ^
a.cc:23:12: error: expected constructor, destructor, or type conversion before '(' token
   23 |         inc(i);dec(j);
      |            ^
a.cc:23:19: error: expected constructor, destructor, or type conversion before '(' token
   23 |         inc(i);dec(j);
      |                   ^
a.cc:24:7: error: 'end' does not name a type
   24 |       end;
      |       ^~~
a.cc:25:3: error: 'until' does not name a type
   25 |   until i>j;
      |   ^~~~~
a.cc:26:3: error: expected unqualified-id before 'if'
   26 |   if l<j then qs(l,j);
      |   ^~
a.cc:27:3: error: expected unqualified-id before 'if'
   27 |   if i<r then qs(i,r);
      |   ^~
a.cc:28:1: error: 'end' does not name a type
   28 | end;
      | ^~~
a.cc:31:1: error: 'begin' does not name a type
   31 | begin
      | ^~~~~
a.cc:33:3: error: expected unqualified-id before 'for'
   33 |   for i:=1 to m do
      |   ^~~
a.cc:36:7: error: 'a' does not name a type
   36 |       a[i]:=p[i];c[i]:=i;
      |       ^
a.cc:36:18: error: 'c' does not name a type
   36 |       a[i]:=p[i];c[i]:=i;
      |                  ^
a.cc:37:5: error: 'end' does not name a type
   37 |     end;
      |     ^~~
a.cc:38:5: error: expected constructor, destructor, or type conversion before '(' token
   38 |   qs(1,m);
      |     ^
a.cc:39:3: error: expected unqualified-id before 'for'
   39 |   for i:=1 to m do
      |   ^~~
a.cc:42:7: error: 'o' does not name a type
   42 |       o[c[i]]:=j;
      |       ^
a.cc:43:5: error: 'end' does not name a type
   43 |     end;
      |     ^~~
a.cc:44:3: error: expected unqualified-id before 'for'
   44 |   for i:=1 to m do
      |   ^~~
a.cc:47:7: error: expected unqualified-id before 'for'
   47 |       for j:=1 to 6 do
      |       ^~~
a.cc:52:20: error: expected constructor, destructor, or type conversion before '(' token
   52 |               write(0);
      |                    ^
a.cc:53:13: error: 'end' does not name a type
   53 |             end else
      |             ^~~
a.cc:55:8: error: 'end' does not name a type
   55 |        end;
      |        ^~~
a.cc:56:12: error: expected constructor, destructor, or type conversion before '(' token
   56 |       write(a[i]);
      |            ^
a.cc:57:7: error: 'zrt' does not name a type
   57 |       zrt:=100000;
      |       ^~~
a.cc:58:7: error: expected unqualified-id before 'for'
   58 |       for j:=1 to 6 do
      |       ^~~
a.cc:63:20: error: expected constructor, destructor, or type conversion before '(' token
   63 |               write(0);
      |                    ^
a.cc:64:13: error: 'end' does not name a type
   64 |             end else
      |             ^~~
a.cc:66:9: error: 'end' does not name a type
   66 |         end;
      |         ^~~
a.cc:67:14: error: expected constructor, destructor, or type conversion before '(' token
   67 |       writeln(o[i]);
      |              ^
a.cc:68:3: error: 'end' does not name a type
   68 |   end;
      |   ^~~
a.cc:69:7: error: 'end' does not name a type
   69 |       end.
      |       ^~~