#include <stdio.h>
#include <string.h>
int main()
{
char a[10], b[10];
scanf("%s%s",&a,&b);
if (strcmp(a,"tiger")==0)
{
if (strcmp(b, "stick")==0)
{
printf("2");
}
else if (strcmp(b, "chicken") == 0)
{
printf("1");
}
else
{
printf("draw");
}
}
else if (strcmp(a, "stick") == 0)
{
if (strcmp(b, "worm") == 0)
{
printf("2");
}
else if (strcmp(b, "tiger") == 0)
{
printf("1");
}
else
{
printf("draw");
}
}
else if (strcmp(a, "chicken") == 0)
{
if (strcmp(b, "tiger") == 0)
{
printf("2");
}
else if (strcmp(b, "worm") == 0)
{
printf("1");
}
else
{
printf("draw");
}
}
else if (strcmp(a, "worm") == 0)
{
if (strcmp(b, "chicken") == 0)
{
printf("2");
}
else if (strcmp(b, "stick") == 0)
{
printf("1");
}
else
{
printf("draw");
}
}
return 0;
}