Given an array of integers. Create a Binary Search Tree from these numbers. If the inserted value equals to the current node, insert it to the right subtree.
Write a method InvertTree that inverts a binary tree.

Inverted tree:

Write the code according to the next interface:
class TreeNode
{
public:
int val;
TreeNode *left;
TreeNode *right;
TreeNode(int x) : val(x), left(NULL), right(NULL) {}
};
class Tree
{
public:
TreeNode *head;
Tree() : head(NULL) {};
void Insert(int val); // Insert number val to Binary Search Tree
void InOrder(void); // Print the elements of Binary Search Tree in InOrder Traversal
void InvertTree(void); // Invert a Binary Search Tree
};You can create (use) additional methods if needed.
The first line contains number (1 \leq n \leq 100). The second line contains integers.
Create the Binary Search Tree from input data. Invert a tree using InvertTree method. Print the elements of Binary Search Tree after inversion using InOrder method.
Example 1