#include <iostream>
#include <sstream>
#include "st.h"

using namespace std;

#ifdef NO_MAIN
extern "C" {
extern int hex_main(int argc, char** argv);
}
int 
hex_main(int argc, char** argv)
#else 
int
main(int argc, char** argv)
#endif 
{
   for(int i = 1; i < argc; i++) {
      stringstream ss;
      ss << hex << argv[i];
      long long val;
      ss >> val;
      cout << val << endl;
   }
   return 0;
}
