Write a program in the language of your choice to detect if a given string of brackets (parentheses, curly braces, square brackets) is balanced.