diff --git a/buggy.py b/buggy.py
--- a/buggy.py
+++ b/buggy.py
@@ -8,7 +8,7 @@
 for i in range(1, n + 1):
     l = len(color[i])
     for j in range(l):
-        ans[color[i][j]] = color[i][(j + 1) % l]
+        ans[color[i][j]] = color[i][(j - 1) % l]
 for i in range(n):
     ans[i] = s[ans[i]]
 print(*ans, sep="")
