#include <stdio.h>
#include <unistd.h>
#include <string.h>

int main() {
  char buf[2222];
  int i = 0;
  int auth=0;
  setlinebuf(stdout);
  puts("220 firestorm.gentei.org ESMTP");
  while (fgets(buf, sizeof buf, stdin)) {
    if (auth) {
      if ('x' == buf[0]) {
        auth=0;
	puts("235 ok");
      }
    } else if (i == 'd') {
      if (0 == strncmp(buf, ".", 1))
        i = 0;
    } else if (0 == strncmp(buf, "auth", 4)) {
      puts("334");
      auth = 1;
    } else if (0 == strncmp(buf, "quit", 4)) {
      puts("221 firestorm.gentei.org");
      break;
    } else if (0 == strncmp(buf, "data", 4)) {
      puts("350 go ahead");
      i = 'd';
    } else {
      puts("260 ok");
    }
    usleep(3000000);
  }
}
