#include <bits/stdc++.h>
int a[1800010], s[1800010];
int left[1800010], right[1800010];
int n, m, h;
int p, e;
char st[100];
int path[31], pn;
int New(int tv) {
  n++;
  s[n] = a[n] = 0;
  return n;
}
void updata(int dep, int p, int e) {
  s[p] += e;
  if (dep == 0) {
    a[p] += e;
    return;
  }
  if (path[dep] << 1 == path[dep - 1]) {
    if (left[p] == 0) left[p] = New(path[dep - 1]);
    updata(dep - 1, left[p], e);
  } else {
    if (right[p] == 0) right[p] = New(path[dep - 1]);
    updata(dep - 1, right[p], e);
  }
}
long long max(long long x, long long y) { return x > y ? x : y; }
long long totv;
void Go(int p, long long maxv, int dep) {
  if (dep == 0) {
    totv += max(maxv, a[p]);
    return;
  }
  if (s[left[p]] > s[right[p]]) {
    totv += max(maxv, s[left[p]] + a[p]) * (1ll << (dep - 1));
    Go(left[p], max(maxv, s[right[p]] + a[p]), dep - 1);
  } else {
    totv += max(maxv, s[right[p]] + a[p]) * (1ll << (dep - 1));
    Go(right[p], max(maxv, s[left[p]] + a[p]), dep - 1);
  }
}
int main() {
  int i, j, k;
  scanf("%d %d", &h, &m);
  n = 1;
  left[1] = right[1] = 0;
  s[1] = a[1] = 0;
  memset(left, 0, sizeof(left));
  memset(right, 0, sizeof(right));
  for (; m > 0; m--) {
    scanf("%s", st);
    if (st[0] == 'a') {
      scanf("%d %d", &p, &e);
      pn = 0;
      k = p;
      while (k > 0) {
        path[pn++] = k;
        k >>= 1;
      }
      updata(pn - 1, 1, e);
    } else {
      totv = 0;
      Go(1, 0, h);
      printf("%.6lf\n", totv * 1.0 / (1 << h));
    }
  }
  return 0;
}
