#include <stdio.h>
#include <stdlib.h>

int main(int argc, char **argv)
{
   if (argc != 2) {
      printf("Usage: %s STRING\n"
             "  Prints STRING without leading and tailing spaces\n", *argv);
   } else {
      char *begin=argv[1], *end=argv[1]+strlen(argv[1])-1;

      for (; end >= begin && isspace(*end); end--);
      ++end;
      *end = '\0';

      for (; begin < end && isspace(*begin); begin++);

      printf("%s", begin);
   }

   return EXIT_SUCCESS;
}
