#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
int main(int argc, char **argv)
{
  int c, lastc;
  static char key[128], *s;
  // a60 case stropping
  for (;;) {
    c = fgetc(stdin);
    for (;;) {  // break will re-read c, continue won't...
      if (c == EOF) {
        exit(0);
      }
      // lc-strop
      s = key; *key = '\0';
      while (c == '_') {
        c = fgetc(stdin);
        if (isalpha(c) && isupper(c)) c = tolower(c);
        if (!isalpha(c)) {
          if (c == ':') c = '/';
          break;
	}
        *s++ = c;
        c = fgetc(stdin);
      }
      *s = '\0';
      // if (strcmp(key, "end") == 0) putchar(';'); NO!!! breaks the intent when there is a dangling else!
      fprintf(stdout, "%s", key);
      if (*key != '\0') {
        *s = '\0';
        if (strcmp(key, "comment") == 0) {
          do {
             putchar(c); c = fgetc(stdin);
	  } while (c != ';');
        } else if (strcmp(key, "begin") == 0) {
 	  putchar(';');
	}
      }

      //      if (c == '<') c = '='; //testing a theory

      if (c == '|') {
        c = fgetc(stdin);
        if (c == '<') c = '"'; 
        else if (c == '=') {putchar('<'); c = '>';}
        else if (c == '^') c = '^'; // |^ is power, ^ is and???
        else {ungetc(c, stdin); c = '|';}
      } else if (c == '^') c = '&';

      if (c == '"') {
        // string
        do {
          putchar(c); c = fgetc(stdin);
          if (c == '|') {
            c = fgetc(stdin);
            if (c == '>') c = '"'; else {ungetc(c, stdin); c = '|';}
          }
	} while (c != '"');
      }
      if (isblank(c)) break;
      if (c == '\n') {
	//        if (lastc == ';') break;
	//        c = ';';
        break;
      }
      if (isalpha(c) && islower(c)) c = toupper(c);
      putchar(c);
      lastc = c;
      c = fgetc(stdin);
    }
  }

}
