import time
start = time.time()
ls = []
for i in xrange(999, 100, -1):
for ii in xrange(i, 100, -1):
string = str(i * ii)
if string[len(string) - 1 : len(string)] == string[0 : 1]:
if string[len(string) - 2 : len(string) - 1] == string[1 : 2]:
if len(string) > 5:
if string[len(string) - 3 : len(string) - 2 ] == string[2 : 3]:
ls.append(string)
breakelse:
ls.append(string)
break
print ls
max = 0
for i in xrange(0, len(ls) - 1):
if (int(ls[i]) > max):
max = int(ls[i])
print max
print " took " + str(time.time() - start) + "seconds"