// MADE BY QT666
#include<cstdio>
#include<algorithm>
#include<cmath>
#include<iostream>
#include<cstring>
#define int long long
using namespace std;
typedef long long ll;
const int N=600050;
int ls[N*4],rs[N*4],rt,sz,n,m;
char ch[N];
struct data{
ll sum1,sum2,sum3;
}tr[N*4];
data operator + (const data &a,const data &b){
return (data){a.sum1+b.sum1,a.sum2+b.sum2,a.sum3+b.sum3};
}
ll sum1[N],sum2[N],sum3[N],lazy[N*4];
void pushup(int x){tr[x]=tr[ls[x]]+tr[rs[x]];}
void insert(int &x,int l,int r,int id){
if(!x) x=++sz;
if(l==r) {tr[x].sum1=tr[x].sum2=tr[x].sum3=0;return;}
int mid=(l+r)>>1;
if(id<=mid) insert(ls[x],l,mid,id);
else insert(rs[x],mid+1,r,id);
pushup(x);
}
void Modify(int x,int v,int l,int r){
tr[x].sum1+=1ll*v*(sum1[r]-sum1[l-1]);
tr[x].sum2+=1ll*v*(sum2[r]-sum2[l-1]);
tr[x].sum3+=1ll*v*(sum3[r]-sum3[l-1]);
}
void update(int x,int l,int r,int xl,int xr,int v){
if(xl<=l&&r<=xr){Modify(x,v,l,r);lazy[x]+=v;return;}
int mid=(l+r)>>1;
if(xr<=mid) update(ls[x],l,mid,xl,xr,v);
else if(xl>mid) update(rs[x],mid+1,r,xl,xr,v);
else update(ls[x],l,mid,xl,mid,v),update(rs[x],mid+1,r,mid+1,xr,v);
pushup(x);Modify(x,lazy[x],l,r);
}
data query(int x,int l,int r,int xl,int xr,int la){
if(xl<=l&&r<=xr){
return (data){
tr[x].sum1+la*(sum1[r]-sum1[l-1]),
tr[x].sum2+la*(sum2[r]-sum2[l-1]),
tr[x].sum3+la*(sum3[r]-sum3[l-1])
};
}
int mid=(l+r)>>1;la+=lazy[x];
if(xr<=mid) return query(ls[x],l,mid,xl,xr,la);
else if(xl>mid) return query(rs[x],mid+1,r,xl,xr,la);
return query(ls[x],l,mid,xl,xr,la)+query(rs[x],mid+1,r,mid+1,xr,la);
}
ll gcd(ll x,ll y){return y?gcd(y,x%y):x;}
main(){
scanf("%lld%lld",&n,&m);
for(int i=1;i<=n;i++) sum1[i]=sum1[i-1]+1,sum2[i]=sum2[i-1]+i,sum3[i]=sum3[i-1]+i*i;
for(int i=1;i<=n-1;i++) insert(rt,1,n-1,i);
for(int i=1;i<=m;i++){
scanf("%s",ch+1);
if(ch[1]==‘Q‘){
int l,r;scanf("%lld%lld",&l,&r);
r--;data ans=query(rt,1,n-1,l,r,0);
ll fm=-ans.sum3+1ll*(l+r)*ans.sum2-1ll*(l-r-1+l*r)*ans.sum1;
ll fz=1ll*(r-l+2)*(r-l+1)/2;
ll Gcd=gcd(fm,fz);
printf("%lld/%lld\n",fm/Gcd,fz/Gcd);
}
else{
int l,r,v;scanf("%lld%lld%lld",&l,&r,&v);
r--;update(rt,1,n-1,l,r,v);
}
}
return 0;
}