void print_tree(A* a,int x=0) {
x++;
cout << x << "\t\t\t";
if (!a)cout << a->count << " " << a->s << endl;
cout << endl;
x++;
cout << x << "\t\t\t";
if (!a->left) cout << a->left->count << " " << a->left->s << "\t";
if (!a->right)cout << a->right->count << " " << a->right->s << "\t";
cout << endl;
x++;
cout << x << "\t\t\t";
if (!a->left->left)cout << a->left->left->count << " " << a->left->left->s << "\t";
if (!a->left->right)cout << a->left->right->count << " " << a->left->right->s << "\t";
if (!a->right->left)cout << a->right->left->count << " " << a->right->left->s << "\t";
if (!a->right->right)cout << a->right->right->count << " " << a->right->right->s << "\t";
cout << endl;
x++;
cout << x << "\t\t\t";
if (!left->left->left)cout << a->left->left->left->count << " " << a->left->left->left->s << "\t";
if (!a->left->left->right)cout << a->left->left->right->count << " " << a->left->left->right->s << "\t";
if (! a->left->right->left)cout << a->left->right->left->count << " " << a->left->right->left->s << "\t";
if (!a->left->right->right)cout << a->left->right->right->count << " " << a->left->right->right->s << "\t";
if (!a->right->left->left)cout << a->right->left->left->count << " " << a->right->>left->left->s << "\t";
if (!a->right->left->right)cout << a->right->left->right->count << " " << a->right->left->right->s << "\t";
if (!a->right->right->left)cout << a->right->right->left->count << " " << a->right->right->left->s << "\t";
if (!a->right->right->right)cout << a->right->right->right->count << " " << a->right->right->right->s << "\t";
cout << endl;
}