#include<stdio.h>
#include<time.h>
#include<stdlib.h>
#include<string.h>
using namespace std;

int get_rand(){
  return rand();
}

int get_num(char tar[]){
  if(strcmp(tar,"개") == 0) return 0;
  else if(strcmp(tar,"말") == 0) return 1;
  else if(strcmp(tar,"소") == 0) return 2;
  else if(strcmp(tar,"돼지") == 0) return 3;
  else if(strcmp(tar,"닭") == 0) return 4;
  else return -1;
}

void print_ani(int tar){
  switch(tar){
    case 0: printf("개"); return;
    case 1: printf("말"); return;
    case 2: printf("소"); return;
    case 3: printf("돼지"); return;
    case 4: printf("닭"); return;
    default: printf("ERR"); return;
  }
}

void init(){
  srand(time(NULL));
}


enum {dog,horse,cow,pig,chicken} ani;
//개=0, 말=1, 소=2, 돼지=3, 닭=4

int cnt[5];
int voted[55][2];

int main(){
  //freopen("input.txt","r",stdin);
  //freopen("output.txt","w",stdout);

  init();

  for(int iter=0;;iter++){
    char nick[55];
    char t1[5], t2[5];

    if(scanf("%s %s %s",nick,t1,t2)==EOF) break;
    int c1 = get_num(t1), c2 = get_num(t2);
    voted[iter][0] = c1; voted[iter][1] = c2;

    for(int aniter=0; aniter<5; aniter++){
      if(aniter==c1 || aniter==c2) continue;

      int rnd = get_rand();
      bool isGo;
      if(rnd % 2 == 1) isGo = true;
      else isGo = false;

      if(isGo) cnt[aniter]++;

      print_ani(aniter);
      printf("에게 %s님께서 여물을 주",nick);
      if(isGo == false) printf("었지만 전진하지 않았습니다.");
      else printf("어서 전진하였습니다.");
      printf("\n");
    }
    printf("\n");
  }

  printf("\n전진한 칸 수: \n");
  for(int aniter = 0; aniter < 5; aniter++){
    print_ani(aniter);
    printf(": %d", cnt[aniter]);
    if(aniter != 5-1) printf(", ");
  }


  return 0;
}
