#include <bits/stdc++.h>
using namespace std;
const int M = 2e6;
int c[M][2], s[M], v[M];
int h, q, x, y, z, cc, i, j, ds = 1, now;
double ans, pos;
inline void read(int &x) {
  cc = getchar();
  while ((cc < 48) || (cc > 57)) cc = getchar();
  x = cc ^ 48;
  cc = getchar();
  while ((cc >= 48) && (cc <= 57)) {
    x = x * 10 + (cc ^ 48);
    cc = getchar();
  }
}
int main() {
  read(h);
  read(q);
  while (q--) {
    cc = getchar();
    while ((cc != 'a') && (cc != 'd')) cc = getchar();
    if (cc == 'a') {
      read(y);
      read(z);
      x = 1;
      for (i = h; ~i; i--)
        if (1 << i & y) break;
      for (--i; ~i; --i) {
        s[x] += z;
        j = y >> i & 1;
        if (!c[x][j]) c[x][j] = ++ds;
        x = c[x][j];
      }
      s[x] += z;
      v[x] += z;
    } else {
      getchar();
      getchar();
      getchar();
      getchar();
      ans = now = 0;
      x = 1;
      pos = 0.5;
      while (x) {
        i = (s[c[x][1]] > s[c[x][0]]);
        ans += max(s[c[x][i]] + v[x], now) * pos;
        now = max(now, s[c[x][i ^ 1]] + v[x]);
        x = c[x][i];
        pos /= 2;
      }
      ans += now * pos * 2;
      printf("%.7f\n", ans);
    }
  }
}
