Given a string s containing just the characters ’(’, ’)’, ’[’, ’]’ ’{’ and ’}’ , deter￾mine if the input string is balanced. 
Print “Balanced” if the string is balanced otherwise print “Not Balanced” 
You can use the stack data structure developed in the above question. 

An input string is balanced if: 
• Open brackets must be closed by the same type of brackets. 
• Open brackets must be closed in the correct order. 
Additional Constraints: 
• Curved ( ) brackets can contain only ( ) brackets 
• Square brackets [ ] can contain only [ ] and ( ) brackets 
• Curly { } brackets can contain { }, [ ] and ( ) brackets 
Input format: 
• First line contains an integer N denoting the number of inputs 
• Next N line contains the input string 
Output format: 
• For each input string print “Balanced” or “Not Balanced” in a new line 
Example 
Input: 
3 
{()()} 
[{}()] 
{[()]{}()} 
Output: 
Balanced 
Not Balanced 
Balanced