def itOne(n,d,m,i):
return (n*m+i) if n%d else n//d
def itFull(n,d,m,i):
ni=n
cs=[ni]
while ni not in cs[:-1] and ni<=10**9 and len(cs)<1000:
ni=itOne(ni,d,m,i)
cs.append(ni)
return cs
strin=input()
d,m,i=map(int,strin.split())
s=[itFull(n,d,m,i) for n in range(1,1001)]
r=[]
for se in s:
if se[-1]>10**9 or len(se)>=1000:
r+=[(0,)]
else:
i=se.index(se[-1])
cl=se[i:-1]
ci=(cl.index(min(cl))+1)%len(cl)
cu=cl[ci:]+cl[:ci]
r+=[tuple(cu)]
rs=sorted(set(r),key=lambda l:l[-1])
for re in rs:
print('LOOP',*re) if re[-1]>0 else print('DIVERGENT')
ZGVmIGl0T25lKG4sZCxtLGkpOiAgICAKICAgIHJldHVybiAobiptK2kpIGlmIG4lZCBlbHNlIG4vL2QKCmRlZiBpdEZ1bGwobixkLG0saSk6CiAgICBuaT1uCiAgICBjcz1bbmldCiAgICB3aGlsZSBuaSBub3QgaW4gY3NbOi0xXSBhbmQgbmk8PTEwKio5IGFuZCBsZW4oY3MpPDEwMDA6CiAgICAgICAgbmk9aXRPbmUobmksZCxtLGkpCiAgICAgICAgY3MuYXBwZW5kKG5pKQogICAgcmV0dXJuIGNzCgpzdHJpbj1pbnB1dCgpCmQsbSxpPW1hcChpbnQsc3RyaW4uc3BsaXQoKSkKCnM9W2l0RnVsbChuLGQsbSxpKSBmb3IgbiBpbiByYW5nZSgxLDEwMDEpXQpyPVtdCiAKZm9yIHNlIGluIHM6ICAgIAogICAgaWYgc2VbLTFdPjEwKio5IG9yIGxlbihzZSk+PTEwMDA6CiAgICAgICAgcis9WygwLCldCiAgICBlbHNlOgogICAgICAgIGk9c2UuaW5kZXgoc2VbLTFdKQogICAgICAgIGNsPXNlW2k6LTFdCiAgICAgICAgY2k9KGNsLmluZGV4KG1pbihjbCkpKzEpJWxlbihjbCkKICAgICAgICBjdT1jbFtjaTpdK2NsWzpjaV0KICAgICAgICByKz1bdHVwbGUoY3UpXSAgICAKCnJzPXNvcnRlZChzZXQociksa2V5PWxhbWJkYSBsOmxbLTFdKQoKZm9yIHJlIGluIHJzOgogICAgcHJpbnQoJ0xPT1AnLCpyZSkgaWYgcmVbLTFdPjAgZWxzZSBwcmludCgnRElWRVJHRU5UJykK