#define _CRT_SECURE_NO_WARNINGS 1
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include<math.h>
int main()
{
char A[1000];
fgets(A, 1000, stdin);
int n = strlen(A) - 1, i, j, k, count = 0;
double y;
for (i = 0; i < n; i++)
{
if (A[i] == 'S')
{
printf("WA");
break;
}
if (A[i] == 'U') count++;
if (i == n - 1)
{
y = (double)count / (double)n;
if (fabs(y - 0.5) <= 0.003)
{
j = count;
k = n;
int t;
while (k > 0)
{
t = j % k;
j = k;
k = t;
}
printf("%d/%d", count / j, n / j);
break;
}
else
{
printf("Fail");
break;
}
}
}
return 0;
}