var
n,d,w,i,j,l,a:longint;
f,s,f1:array[0..100000]of longint;
begin
assign(input,'fracdec.in');
assign(output,'fracdec.out');
reset(input);
rewrite(output);
read(n,d);
write(n div d,'.');
f[0]:=n mod d;
if f[0]>=100000 then l:=6;
if (f[0]<100000)and(f[0]>=10000) then l:=5;
if (f[0]<10000)and(f[0]>=1000) then l:=4;
if (f[0]<1000)and(f[0]>=100) then l:=3;
if (f[0]<100)and(f[0]>=10) then l:=2;
if f[0]<10 then l:=1;
inc(l);
for a:=0 to d do
f1[a]:=-1;
f1[f[0]]:=0;
repeat
inc(w);
f[w]:=(f[w-1]*10) mod d;
s[w]:=(f[w-1]*10) div d;
if f1[f[w]]<0 then f1[f[w]]:=w else
begin
j:=1;
break;
end;
f1[f[w]]:=w;
until (j=1)or(f[w]=0);
if j=1 then
begin
i:=f1[f[w]];
for a:=1 to i do
begin
write(s[a]);
inc(l);
if l mod 76=0 then writeln;
end;
if not(f[1]=0) then
begin
write('(');
inc(l);
for a:=i+1 to w do
begin
if l mod 76=0 then writeln;
write(s[a]);
inc(l);
end;
if l mod 76=0 then writeln;
writeln(')');
end;
end;
if f[w]=0 then
begin
for a:=1 to w do
begin
write(s[a]);
inc(l);
if l mod 76=0 then writeln;
end;
writeln;
end;
close(input);close(output);
end.