/*Jonathan Walker

Langham Creek High School

Senior 3 Contest #1*/

import java.util.*;

import java.io.*;

 

public class ACSL_probability

{

            private static int total,red,blue,white,num;

            private static boolean replace;

            private static ArrayList<Character> marbles=new ArrayList();

            private static int numerator,denominator;

           

            public static void main(String[] args)throws IOException

            {

                        Scanner file=new Scanner(new File("ascon106.txt"));

                       

                        while(file.hasNextLine())

                        {

                                    Scanner sc=new Scanner(file.nextLine()).useDelimiter(", ");

                                   

                                    marbles.clear();

                                    num=sc.nextInt();

                                    if(num==0)

                                    {

                                                System.out.println("none.");

                                                continue;

                                    }

                                    red=sc.nextInt();

                                    blue=sc.nextInt();

                                    white=sc.nextInt();

                                    total=red+blue+white;

                                    numerator=1;

                                    denominator=1;

                                   

                                    if(num>1)       replace=(sc.next().charAt(0)=='Y' ? true : false);

                                   

                                    for(int a=0;a<num;a++)

                                    {

                                                marbles.add(sc.next().charAt(0));

                                    }

                                   

                                    //System.out.println(num+" "+red+" "+blue+" "+white+" "+total+" "+replace+" "+marbles);

 

                                    while(marbles.size()>0)

                                    {

                                    //          System.out.print(marbles);

                                                char c=marbles.remove(0);

                                                switch(c)

                                                {

                                                            case 'R':

                                                                        numerator*=red;

                                                                        denominator*=total;

                                                                        if(!replace)     red--;

                                                                        break;

                                                            case 'B':

                                                                        numerator*=blue;

                                                                        denominator*=total;

                                                                        if(!replace)     blue--;

                                                                        break;

                                                            case 'W':

                                                                        numerator*=white;

                                                                        denominator*=total;

                                                                        if(!replace)     white--;

                                                                        break;

                                                            case 'r':

                                                                        numerator*=(total-red);

                                                                        denominator*=total;

                                                                        break;

                                                            case 'b':

                                                                        numerator*=(total-blue);

                                                                        denominator*=total;

                                                                        break;

                                                            case 'w':

                                                                        numerator*=(total-white);

                                                                        denominator*=total;

                                                                        break;

                                                }

                                               

                                                if(!replace)     total--;

                                    }

                                   

                                    System.out.println(numerator+"/"+denominator);

                        }

            }

}