import sequtils, strutils var n: seq[int] = stdin.readline.split.map(parseInt) ans: int = 0 while n[0] > 0: var i: int = (ans mod 12) + 1 if n[2] <= i and i < n[2] + n[3]: n[0] -= 2 * n[1] else: n[0] -= n[1] ans.inc echo ans