#include <bits/stdc++.h>
using namespace std;
int n, m;
map<int, int> num, tot;
char buffer[222];
inline int get_num(int k) {
  if (num.count(k)) {
    return num[k];
  }
  return 0;
}
inline int get_tot(int k) {
  if (tot.count(k)) {
    return tot[k];
  }
  return 0;
}
int main() {
  scanf("%d%d", &n, &m);
  while (m--) {
    scanf("%s", buffer);
    if (buffer[0] == 'a') {
      int a, b;
      scanf("%d%d", &a, &b);
      num[a] += b;
      tot[a] += b;
      while (a > 1) {
        a >>= 1;
        tot[a] += b;
      }
    } else {
      double result = 0;
      int now = 1;
      int cnt = 1 << n;
      int all = 1 << n;
      int s = 0;
      for (int i = 1; i <= n + 1; i++) {
        if (i == n + 1) {
          result += 1.0 * max(get_num(now), s) / all;
          break;
        }
        cnt >>= 1;
        int lc = now << 1, rc = lc | 1;
        int t = get_num(now);
        int v_lc = t + get_tot(lc), v_rc = t + get_tot(rc);
        if (max(v_lc, v_rc) <= s) {
          result += 2.0 * s * cnt / all;
          break;
        }
        int k = -1;
        if (v_lc >= v_rc - t) {
          result += 1.0 * max(s, v_lc) * cnt / all;
          k = lc;
        } else if (v_rc >= v_lc - t) {
          result += 1.0 * max(s, v_rc) * cnt / all;
          k = rc;
        }
        now = k;
        s = max(s, t + get_tot(k ^ 1));
      }
      printf("%.6f\n", result);
    }
  }
}
