program robotas_ir_kubeliai;
{ 146 u‘davinys }
  procedure kelti (x, y, kub: integer);
  { perkelia kub kubeli— nuo kr–vel‚s x ant kr–vel‚s y }
    var i: integer;
  begin
    for i := 1 to kub do
      writeln (x, ' ', y);
  end; { kelti }

  procedure kilnoti_kubelius (k1, k2, k3: integer);
    var kub, liko, turi1, turi2, turi3: integer;
  begin
    { rasime kubeli— skai‡i— kiekvienoje kr–vel‚je }
    kub := (k1 + k2 + k3) div 3;
    liko := (k1 + k2 + k3) mod 3;
    turi1 := kub; turi2 := kub; turi3 := kub;
    if liko > 0
       then if k1 < k3
               then turi3 := turi3 + 1
               else turi1 := turi1 + 1;
    if liko = 2
       then turi2 := turi2 + 1;
    { perkilnojame kubelius, jei juos reikia perkelti }
    if (k1 = turi1) and (k2 = turi2) and (k3 = turi3)
       then writeln ('GERAI')
       else begin
              if k1 > turi1 then begin
                                   kelti (1, 2, k1 - turi1);
                                   k2 := k2 + (k1-turi1);
                                 end;
              if k3 > turi3 then begin
                                   kelti (3, 2, k3 - turi3);
                                   k2 := k2 + (k3-turi3)
                                 end;
              if k2 > turi2
                      then begin
                             if k1 < turi1
                                then kelti (2, 1, turi1 - k1);
                             if k3 < turi3
                                then kelti (2, 3, turi3 - k3);
                           end;
            end;
  end; { kilnoti_kubelius }

  var k1, k2, k3: integer;
begin
  writeln ('­veskite kubeli— skai‡i— kiekvienoje kr–vel‚je: ');
  readln (k1, k2, k3);
  kilnoti_kubelius (k1, k2, k3);
end.