from itertools import cycle

freq = 0
uniqueFreq = {0}

data = [int(x) for x in open('day1inputs.txt').readlines()]

for increment in cycle(data):
    freq += increment

    if freq in uniqueFreq:
        print freq
        break
    uniqueFreq.add(freq)

f9e5c1f829d6f3a7e543f085fa68b9e37440b566
from itertools import cycle

freq = 0
uniqueFreq = {0}

data = [int(x) for x in open('day1inputs.txt').readlines()]

for increment in cycle(data):
    freq += increment

    if freq in uniqueFreq:
        print freq
        break
    uniqueFreq.add(freq)
