For this Question: Given a string S, containing only letters { 'N', 'E', 'W', 'T', 'O'} like "NWTEONEW" or "NEWTON" your task is to print all the substring of size 10 which occur more than once in the given string.Input contains a single line containing the string S.

Constraints:-
10 < = |String| < = 10000Print all the sequences in lexicographical order separated by spaces, if their is no such substring exist print -1.Sample Input:-
NEWTONNEWTONNEWTON

Sample Output:-
EWTONNEWTO NEWTONNEWT WTONNEWTON

Sample Input:-
NETOWNEWOTTONTOONW

Sample Output:-
-1, I have written this Solution Code: string = input()
Dict = {}
n = len(string) - 9
for i in range(n):
    sub = string[i:i+10]
    if sub not in Dict:
        Dict[sub] = 1
    else :
        Dict[sub] = Dict[sub] + 1

l = []

for i in Dict:
    if Dict[i] > 1:
        l.append(i)

l = sorted(l)

if len(l)==0:
    print(-1)
else:
    for i in l:
        print(i , end = " "), In this Programming Language: Python, Now tell me if this Code is compilable or not?