#include <bits/stdc++.h>
int h, q;
std::map<int, int> S, a;
int main() {
  scanf("%d%d", &h, &q);
  while (q--) {
    char opt[23];
    scanf("%s", opt);
    if (opt[0] == 'a') {
      int x, y;
      scanf("%d%d", &x, &y);
      a[x] += y;
      while (x) S[x] += y, x >>= 1;
    }
    if (opt[0] == 'd') {
      int x = 1;
      long long ans = 0;
      int mx = 0;
      for (int i = 1; i <= h; ++i) {
        int o = 1 << (h - i);
        if (S[x << 1] < S[x << 1 | 1]) {
          ans += 1ll * o * std::max(mx, S[x << 1 | 1] + a[x]);
          mx = std::max(mx, S[x << 1] + a[x]);
          x = x << 1 | 1;
        } else {
          ans += 1ll * o * std::max(mx, S[x << 1] + a[x]);
          mx = std::max(mx, S[x << 1 | 1] + a[x]);
          x = x << 1;
        }
      }
      ans += std::max(mx, a[x]);
      double res = ans;
      for (int i = 1; i <= h; ++i) res /= 2;
      printf("%.10f\n", res);
    }
  }
  return 0;
}
