#include <bits/stdc++.h>
using namespace std;
int h;
map<int, int> a, b;
void add(int v, int e) {
  a[v] += e;
  while (v >= 1) b[v] += e, v /= 2;
}
double fun(int x, int d, double big) {
  if (d == h) {
    if (a.find(x) == a.end()) return big;
    double ans = a[x];
    if (big > ans) ans = big;
    return ans;
  }
  double cur = a[x], l = b[2 * x], r = b[2 * x + 1];
  double ans1 = max(big, cur + l);
  if (r > ans1 && r > cur + l + 0.5) ans1 = fun(2 * x + 1, d + 1, ans1);
  double ans2 = max(big, cur + r);
  if (l > ans2 && l > cur + r + 0.5) ans2 = fun(2 * x, d + 1, ans2);
  return (ans1 + ans2) / 2.;
}
int main() {
  int m, i, j;
  while (~scanf("%d%d", &h, &m)) {
    a.clear(), b.clear();
    while (m--) {
      char s[7];
      scanf("%s", s);
      if (s[0] == 'a') {
        scanf("%d%d", &i, &j);
        add(i, j);
      } else
        printf("%lf\n", fun(1, 0, 0.0));
    }
  }
  return 0;
}
