#include <stdio.h>
#include <map>
using namespace std;
int main()
{
int a, b, c, q, r, places;
map<int, int> rmap;
pair<map<int, int>::iterator, bool> pr;
int qarr[50];
while (scanf("%d %d", &a, &b) == 2)
{
rmap.clear();
places = 0;
r = a % b;
for (;;)
{
c = r * 10;
pr = rmap.insert(make_pair(c, places));
if (!pr.second)
break;
q = c / b;
r = c % b;
if (places < 50)
qarr[places] = q;
++places;
}
printf("%d/%d = %d.", a, b, a/b);
r = places > 50 ? 50 : places;
for (c = 0; c < r; ++c)
{
if (c == (pr.first)->second)
putchar('(');
printf("%d", qarr[c]);
}
if (places > 50)
printf("...");
printf(")\n %d = number of digits in repeating cycle\n\n", places - (pr.first)->second);
}
return 0;
}