diff --git a/buggy.py b/buggy.py
--- a/buggy.py
+++ b/buggy.py
@@ -6,8 +6,8 @@
     s = list(map(str, input()))
     s1, s2 = s, deque()
     tt = False
-    ss = True
     for i in range(n - 1):
+        ss = True
         s2.appendleft(s1[-1])
         s1.pop()
         for j in range(min(len(s1), len(s2))):
