|   | 1 |  initial version  | 
SageMath code is written in Python (with a few extensions by the preparser). Your code does not resemble Python.
Indentation matters, no end is required, forloops are written as for b in s:, functions are defined as def bruteforce():, write print instead of puts.
 Copyright Sage, 2010. Some rights reserved under creative commons license. Content on this site is licensed under a Creative Commons Attribution Share Alike 3.0 license.
 
                
                Copyright Sage, 2010. Some rights reserved under creative commons license. Content on this site is licensed under a Creative Commons Attribution Share Alike 3.0 license.