#include <bits/stdc++.h>
using namespace std;
int h, m;
map<int, unsigned long long> sum;
void add(int x, unsigned long long v) {
  while (x) {
    sum[x] += v;
    x /= 2;
  }
  return;
}
double query(int u, unsigned long long other) {
  if (sum[u] <= other) {
    return (double)other;
  }
  double ls = query(u * 2, max(other, sum[u] - sum[u * 2]));
  double rs = query(u * 2 + 1, max(other, sum[u] - sum[u * 2 + 1]));
  return (ls + rs) * 0.5;
}
int main() {
  {
    h = 0;
    char ch;
    int f = 0;
    do {
      ch = getchar();
      if (ch == '-') {
        f = 1;
      }
    } while (ch < '0' || ch > '9');
    while ('0' <= ch && ch <= '9') {
      h = (h << 1) + (h << 3) + ch - 48;
      ch = getchar();
    }
    if (f) h = -h;
  }
  {
    m = 0;
    char ch;
    int f = 0;
    do {
      ch = getchar();
      if (ch == '-') {
        f = 1;
      }
    } while (ch < '0' || ch > '9');
    while ('0' <= ch && ch <= '9') {
      m = (m << 1) + (m << 3) + ch - 48;
      ch = getchar();
    }
    if (f) m = -m;
  }
  char c[6];
  int x, y;
  for (int i = 1; i <= m; i++) {
    scanf("%s", &c);
    if (c[0] == 'a') {
      {
        x = 0;
        char ch;
        int f = 0;
        do {
          ch = getchar();
          if (ch == '-') {
            f = 1;
          }
        } while (ch < '0' || ch > '9');
        while ('0' <= ch && ch <= '9') {
          x = (x << 1) + (x << 3) + ch - 48;
          ch = getchar();
        }
        if (f) x = -x;
      }
      {
        y = 0;
        char ch;
        int f = 0;
        do {
          ch = getchar();
          if (ch == '-') {
            f = 1;
          }
        } while (ch < '0' || ch > '9');
        while ('0' <= ch && ch <= '9') {
          y = (y << 1) + (y << 3) + ch - 48;
          ch = getchar();
        }
        if (f) y = -y;
      }
      add(x, (unsigned long long)y);
    } else {
      printf("%.6lf\n", query(1, 0.0));
    }
  }
  return 0;
}
