a:string;
i:integer;
begin
assign(F,'in.txt');
assign(G,'out.txt');
reset(F);
rewrite(G);
while not EOF(F) do begin
readln(F,a);
for i:=1 to length(a) do begin
if(a[i]='(') and (a[i-1]<>'''') then begin
delete(a,i,length(a));
end;
if(a[i]=')') and (a[i+1]<>'''') then begin
delete(a,length(a)-i,i);
end;
end;
writeln(G,a);
end;
close(F);
close(G);
end.
Ответ: в решение