public static void Main()
char lastChar = code[^1];
char penultimateChar = code[^2];
if (lastChar is >= 'A' and < 'Z')
else if (lastChar is 'Z')
if (lastChar is 'Z' && penultimateChar < 'Z')
else if (penultimateChar is 'Z')
throw new System.InvalidOperationException("Limite atingido!");
code = code[..^2] + penultimateChar + lastChar;