from bisect import * from math import hypot, isclose (n, m), l = map(int, input().split()), float(input()) zigzag = [pos for sublist in [[(0, y), (n, y)] for y in range(int(m))] for pos in sublist] ds = [d for sublist in [[y * (n + hypot(n, 1)), y * (n + hypot(n, 1)) + n] for y in range(int(m))] for d in sublist] split = bisect([d + hypot(n - x, m - y) for (x, y), d in zip(zigzag, ds)], l) l -= ds[split - 1] res, new_y = zigzag[:split], zigzag[split][1] al, ah = 0, n # Binary search for the in-between point to finish the cable if split % 2 == 0: # Just moved from left to right, so move to left (and one up) while not isclose(al, ah): a = (al + ah) / 2 if hypot(a, 1) + hypot(a, m - new_y) < l: al = a else: ah = a res.append((n - a, new_y)) if split % 2 == 1: # Just moved from right to left (and one up), so move to right while not isclose(al, ah): a = (al + ah) / 2 if a + hypot(n - a, m - new_y) < l: al = a else: ah = a res.append((a, new_y)) old_res, res = res, [] for y in range((len(old_res) - 4) // 2): res.extend((x, y) for x in range(n + 1)) res.extend(old_res[max(0, (len(old_res) - 4) // 2 * 2):]) print(str(len(res) + 1) + "\n" + "\n".join(f"{a} {b}" for a, b in (*res, (n, m))))