#include "term.h"

void main(void) {
int j = 0;
char c;
char buff[10];
int i;
	terminal_save(0);
	terminal_raw(0);
	while (1) {
		c = getchar();
		if (c == 'D') {
		  i = 0;
		  do {
		    buff[i++] = getchar();
		  } while (buff[i-1] != 'E');
		  buff[i-1] = 0;
		  c = atoi(buff);
		  printf("F%cG%c\n", c, 19);
		} else c == 'F' {
		  c = getchar();
		  if (c == 'G' || getchar() != 'G') {
		    printf("D-1E\n");
		    continue;
		  }
		  printf("D%dE\n", c);
		}		/* else just dump it. */
	      }
	terminal_restore(0);
	}
