program steve1(output);

uses StringUtils;

var
    src : string (255)="abc x";
    dest : string (255);
    i : integer;

procedure Error (const s : String);
begin
  WriteLn ('failed ', s);
  Halt (1)
end;

begin
   i := 1;
   if not StrReadWord(src,i,dest) then Error ('r1');
   if i <> 4 then Error ('i1');
   if dest <> 'abc' then Error ('d1');
   if not StrReadWord(src,i,dest) then Error ('r2');
   if i <> 6 then Error ('i2');
   if dest <> 'x' then Error ('d2');
   if StrReadWord(src,i,dest) then Error ('r3');
   WriteLn ('OK')
end.
