import math
def GetLongestSubstring(s) :
start, end, max, i = 0, 0, 0, 0
size = len(s)
while (i < size - 1) :
j = i + 1
while (j < size) :
if (s[i] == s[j]) :
temp = abs(j - i - 1)
if (temp > max) :
max = temp
start = i + 1
end = j
j += 1
i += 1
return s[start:end]
s = "zXoDpythonprogrammingDkmq"
result = GetLongestSubstring(s)
print(result)
'''
run:
pythonprogramming
'''