private String fraction(long mod, long divider) {
            ArrayList<Long> mods = new ArrayList<Long>();
            mods.add(mod);
            ArrayList<Long> remainders = new ArrayList<Long>();
            int i;
            while (true) {
                mod *= 10;
                remainders.add(mod / divider);
                mod = mod % divider;
                if (mod == 0) {
                    i = -1;
                    break;
                }
                i = mods.indexOf(mod);
                if (i >= 0) {
                    break;
                }
                mods.add(mod);
            }
            StringBuilder builder = new StringBuilder();
            if (i < 0) {
                for (long r : remainders) {
                    builder.append(r);
                }
            } else {
                int j = 0;
                for (; j < i; j++) {
                    builder.append(remainders.get(j));
                }
                builder.append('(');
                for (; j < remainders.size(); j++) {
                    builder.append(remainders.get(j));
                }
                builder.append(')');
            }
            return builder.toString();
        }