#include <iostream>
using namespace std;

typedef double DATA;

class bstree{
 struct bnode{
  DATA d;
  bnode* left;
  bnode* right;
  bnode( const DATA& cd )
  :d(cd), left(NULL), right(NULL)
  {}
 };
 bnode* root;
 int len;
 bstree(const bstree& cb){}
 bstree& operator=(const bstree& cb){return *this;}
 void clear( bnode* & ptree ){
  if( ptree==NULL )
   return;
  clear( ptree->left );
  clear( ptree->right );
  delete ptree;
  ptree = NULL;
  len--;
 }
 void insert( bnode* & ptree, bnode* np ){
  if( ptree==NULL )
   ptree = np;
  else if( np->d < ptree->d )
   insert( ptree->left, np );
  else
   insert( ptree->right, np );
 }
 void show( bnode* ptree ){
  if( ptree==NULL )
   return;
  show( ptree->left );
  cout << ptree->d << ' ';
  show( ptree->right );
 }
public:
 bstree():len(0){ root=NULL; }
 ~bstree(){ clear(); }
 void clear(){clear(root);}
 void insert( const DATA& cd ){
  insert( root, new bnode(cd) );
  len++;
 }
 void show(){
  show( root );
  cout << endl;
 }
 int size(){ return len; }
 bool empty(){ return root==NULL; }
};

int main()
{
 bstree bs;
 DATA d;
 while( cin.peek()!='\n' ){
  cin >> d;
  bs.insert( d );
 }
 cout << bs.size() << " data:" << endl;
 bs.show();
 return 0;
}