var
s:string;
begin
ReadLn(s);
while (Pos('(',s)<>0) and (Pos(')',Copy(s,Pos('(',s),Length(s)))<>0) do
Delete(s,Pos('(',s),Pos(')',Copy(s,Pos('(',s),Length(s))));
WriteLn(s);
ReadLn
end.
var
s:string;
begin
ReadLn(s);
while (Pos('(',s)<>0) and (Pos(')',Copy(s,Pos('(',s),Length(s)))<>0) do
Delete(s,Pos('(',s),Pos(')',Copy(s,Pos('(',s),Length(s))));
WriteLn(s);
ReadLn
end.