#include <bits/stdc++.h>
using namespace std;

using ll = long long;

#define REP(i, n) for(int (i) = 0; (i) < (n); ++(i))
#define REPR(i, n) for(int (i) = (n); (i) >= 0; --(i))
#define FOR(i, n, m) for(int (i) = (n); (i) < (m); ++(i))

template<class T> inline bool chmax(T& a, const T& b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, const T& b) { if (a > b) { a = b; return 1; } return 0; }
constexpr int INF = 1e9;
constexpr ll INFL = 1LL << 61;
constexpr ll mod = 1e9+7;

double dp[105][105][105];
bool flag[105][105][105];

double rec(int A, int B, int C){
  if(flag[A][B][C]) return dp[A][B][C];
  if(A==100 || B == 100 || C == 100){
    return 0;
  }
  flag[A][B][C] = true;
  double sum = A + B + C;
  double res = A / sum * (rec(A+1, B, C)+1) + B / sum * (rec(A, B+1, C)+1) + C / sum * (rec(A, B, C+1)+1);
  return dp[A][B][C] = res;
}
int main(){
  int A, B, C;
  cin >> A >> B >> C;
  printf("%.9f\n", rec(A, B, C));

  return  0;
}


#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
const long long INF = 1LL<<60;
const double PI = acos(-1.0);
/*const double PI = atan2(0.0,-1.0)*/
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }
#define rep(i, n) for(ll i = 0; i < (ll)(n); i++)
#define rep1(i,aa,n) for(ll i = aa; i <= (ll)(n); i++)
#define ALL(a)  (a).begin(),(a).end()
#define ar_init(aa,val) rep(i,aa.size()) aa[i]=val;
#define v2d(aa,val1,val2,ini) vector<vector<ll>> aa(val1,vector<ll>(val2,ini));
#define pqe priority_queue<ll>
#define pqeg priority_queue<ll,vector<ll>,greater<ll>>
#define lcin(...) ll __VA_ARGS__;CINT(__VA_ARGS__)
#define eout(...) COU(__VA_ARGS__);
#define sout(...) SCOU(__VA_ARGS__);
#define scin(...) string __VA_ARGS__;CINT(__VA_ARGS__)
#define lb(aa,val) lower_bound(ALL(aa),val)
#define pb push_back
#define mkp make_pair
#define si size()

void CINT(){}
template <class Head,class... Tail>
void CINT(Head&& head,Tail&&... tail){
    cin>>head;
    CINT(move(tail)...);
}

void COU(){}
template <class Head,class... Tail>
void COU(Head&& head,Tail&&... tail){
    cout<<head<<endl;
    COU(move(tail)...);
}

void SCOU(){}
template <class Head,class... Tail>
void SCOU(Head&& head,Tail&&... tail){
    cout<<head<<" ";
    SCOU(move(tail)...);
}

template <class T = ll>
T IN(){T x;cin>>x;return (x);}

using pii = pair<ll,ll>;
using v2 = vector<vector<ll>>;
using v1 = vector<ll>;
using v2p = vector<vector<pii>>;
using v1p = vector<pii>;
//ll mo=1000000007;
ll mo=998244353;

ll mod_pow(ll N,ll n){
if(n==0) return 1;
ll pp,hh;
pp=n/2;
hh=n%2;
int tt=mod_pow(N,n/2);
if(hh==0)return tt%mo*tt%mo;
else {return tt%mo*tt%mo*N%mo;}
}
long long extGCD(long long a, long long b, long long &x, long long &y) {
    if (b == 0) {
        x = 1;
        y = 0;
        return a;
    }
    long long d = extGCD(b, a%b, y, x); // 再帰的に解く
    y-=a/b*x; 
    return d;
}

ll modpow(ll a, ll n = mo-2) {
	ll r=1;a%=mo;
	while(n) r=r*((n%2)?a:1)%mo,a=a*a%mo,n>>=1;
	return r;
}

v2d (aa,5003,5003,0);
v2d (dp,5003,5003,0);
int main(){

lcin(h,w);
lcin(k);

dp[0][0]=1;
rep(i,k){
ll a,b;
char f;

cin>>a>>b>>f;
if(f=='R'){
aa[a-1][b-1]=1;
}else if(f=='D'){
aa[a-1][b-1]=2;
}else{
aa[a-1][b-1]=3;
}
}

ll g=2*modpow(3);

rep(i,h){
rep(j,w){

if(aa[i][j]){
if(aa[i][j]!=1)dp[i+1][j]+=dp[i][j];
if(aa[i][j]!=2)dp[i][j+1]+=dp[i][j];

}else{

dp[i+1][j]+=g*dp[i][j]%mo;
dp[i][j+1]+=g*dp[i][j]%mo;
dp[i+1][j]%=mo;
dp[i][j+1]%=mo;
}

}
}

eout(mod_pow(3,h*w-k)*dp[h-1][w-1]%mo);

}