#include <iostream>
#include <cstdio>
#include <cstring>
#include <algorithm>
using namespace std;
#define lc x<<1
#define rc x<<1|1
#define m ((l+r)>>1)
#define lson x<<1,l,m
#define rson x<<1|1,m+1,r
const int N=1e5+5;
typedef long long ll;
inline int read(){
char c=getchar();int x=0,f=1;
while(c<‘0‘||c>‘9‘){if(c==‘-‘)f=-1;c=getchar();}
while(c>=‘0‘&&c<=‘9‘){x=x*10+c-‘0‘;c=getchar();}
return x*f;
}
int n,Q;
ll ql,qr,v;
char s[N];
struct node{
int add;
ll s[3];
}t[N<<2];
inline void merge(int x){
for(int i=0;i<3;i++) t[x].s[i]=t[lc].s[i]+t[rc].s[i];
}
inline ll cal(ll l,ll r){return (ll)r*(r+1)*(2*r+1)/6-(ll)(l-1)*l*(2*l-1)/6;}
inline void paint(int x,int l,int r,ll d){
ll len=r-l+1;
t[x].add+=d;
t[x].s[0]+=(ll)len*d;
t[x].s[1]+=(ll)len*(l+r)/2*d;
t[x].s[2]+=cal(l,r)*d;
}
inline void pushDown(int x,int l,int r){
if(t[x].add){
paint(lson,t[x].add);
paint(rson,t[x].add);
t[x].add=0;
}
}
void build(int x,int l,int r){
if(l==r) paint(x,l,r,0);
else{
build(lson);
build(rson);
merge(x);
}
}
void segAdd(int x,int l,int r,int ql,int qr,ll d){
if(ql<=l&&r<=qr) paint(x,l,r,d);
else{
pushDown(x,l,r);
if(ql<=m) segAdd(lson,ql,qr,d);
if(m<qr) segAdd(rson,ql,qr,d);
merge(x);
}
}
ll segQue(int x,int l,int r,int ql,int qr,int k){
if(ql<=l&&r<=qr) return t[x].s[k];
else{
pushDown(x,l,r);
ll ans=0;
if(ql<=m) ans+=segQue(lson,ql,qr,k);
if(m<qr) ans+=segQue(rson,ql,qr,k);
return ans;
}
}
inline ll gcd(ll a,ll b){return b==0?a:gcd(b,a%b);}
int main(){
//freopen("in.txt","r",stdin);
n=read();Q=read();
build(1,1,n-1);
while(Q--){
scanf("%s",s);ql=read();qr=read();
if(s[0]==‘C‘) v=read(),segAdd(1,1,n,ql,qr-1,v);
else{
ll a=segQue(1,1,n,ql,qr-1,0)*(qr-ql*qr)+segQue(1,1,n,ql,qr-1,1)*(ql+qr-1)-segQue(1,1,n,ql,qr-1,2);
ll b=((qr-ql+1)*(qr-ql)/2);
ll g=gcd(a,b);//printf("hi %lld %lld %lld\n",a,b,g);
printf("%lld/%lld\n",a/g,b/g);
}
}
}