#include <iostream>
#include <cstdlib>

using namespace std;

class Parser {
    private:
       istream* is;
       char     tok;    // ultimo atomo leido
       double   dbl;    // ultimo double leido
    public:
       Parser(istream& s); 
       char lex();        // avanza un atomo
       char Tok() const;  // reporta el ultimo atomo leido
       double Dbl() const;  // reporta el ultimo num leido
};

Parser::Parser(istream& s)
{
    is= &s;
    lex();
}

char Parser::lex()
{
    while ( !is->eof() && isspace(is->peek()) )
       is->get(); 

    if (is->eof())
       return tok= '#';

    int c= is->get();      // ultimo caracter leido
    switch (c) {
        case '0': case '1': case '2': case '3': case '4':
        case '5': case '6': case '7': case '8': case '9':
            is->putback(c);
            *is >> dbl;
            return tok= 'n'; 
        case '+':
        case '-':
        case ';':
            return tok= c;
        case 'x':
        case 'X':
            return tok= 'x';
        default:
            return tok= '#';
       }
}

char Parser::Tok() const
{
    return tok;
}

double Parser::Dbl() const
{
    return dbl;
}

int main(int argc, char* argv[])
{
   Parser P(cin);

   while ( P.Tok() != '#' )
      {
       cout << P.Tok();
       P.lex();
      }
   return EXIT_SUCCESS;
}



