#include <bits/stdc++.h>
using namespace std;
char s[101];
long long sz, la, n, t1, i, hh, x, y, now, mx;
map<long long, long long> f, a;
double ans;
int main() {
  scanf("%lld%lld", &n, &t1);
  mx = (1 << n + 1) - 1;
  sz = 1ll << n;
  while (t1--) {
    scanf("%s", s);
    if (s[0] == 'a') {
      scanf("%lld%lld", &x, &y);
      a[x] += y;
      while (x) {
        f[x] += y;
        x /= 2;
      }
    } else {
      now = 1;
      la = 0;
      ans = 0;
      hh = 1ll << n;
      for (i = 1; i <= n; i++) {
        hh /= 2;
        if (f[now * 2] >= f[now * 2 + 1]) {
          ans += (double)max(la, (f[now * 2] + a[now])) * hh;
          la = max(la, f[now * 2 + 1] + a[now]);
          now = now * 2;
        } else {
          ans += (double)max(la, (a[now] + f[now * 2 + 1])) * hh;
          la = max(la, f[now * 2] + a[now]);
          now = now * 2 + 1;
        }
      }
      ans += max(la, a[now]);
      printf("%.10lf\n", ans / (double)sz);
    }
  }
}
