#include <bits/stdc++.h>
using namespace std;
struct Type {
  int val, sum;
  pair<int, int> l, r;
  Type *son[2];
  Type() {
    val = sum = l.first = l.second = r.first = r.second = 0;
    son[0] = son[1] = 0;
  }
} * root, memory[6000050];
int h, q, n, vs, tp, sk[105];
double result;
int Rand() { return (rand() << 15) | rand(); }
void Build(Type *&root) {
  if (!root) {
    memory[++vs] = Type();
    root = &memory[vs];
  }
  return;
}
void Update(Type *&root, long long node, int nowleft, int nowright, int ask,
            int add, int depth) {
  int mid = (nowleft + nowright) >> 1;
  if (nowleft > nowright) {
    return;
  }
  Build(root->son[0]);
  Build(root->son[1]);
  if (node == ask) {
    root->val += add;
    root->sum += add;
    root->l.first = max(root->son[0]->l.second, root->son[0]->r.second);
    root->l.second = max(root->l.first, root->son[1]->sum + root->val);
    root->r.first = max(root->son[1]->l.second, root->son[1]->r.second);
    root->r.second = max(root->r.first, root->son[0]->sum + root->val);
    return;
  }
  if (sk[depth] == 0) {
    Update(root->son[0], node << 1, nowleft, mid, ask, add, depth + 1);
  } else {
    Update(root->son[1], (node << 1) | 1, mid + 1, nowright, ask, add,
           depth + 1);
  }
  root->sum = root->val + root->son[0]->sum + root->son[1]->sum;
  root->l.first = max(root->son[0]->l.second, root->son[0]->r.second);
  root->l.second = max(root->l.first, root->son[1]->sum + root->val);
  root->r.first = max(root->son[1]->l.second, root->son[1]->r.second);
  root->r.second = max(root->r.first, root->son[0]->sum + root->val);
  return;
}
void Solve(Type *root, long long node, int nowleft, int nowright, int depth,
           int best) {
  int mid = (nowleft + nowright) >> 1;
  Build(root->son[0]);
  Build(root->son[1]);
  if (nowleft > nowright) {
    return;
  }
  if (nowleft == nowright) {
    result += max(best, root->val);
    return;
  }
  if (best >= root->son[0]->sum + root->val &&
      best >= root->son[1]->sum + root->val) {
    result += 1.0 * (1 << (h - depth)) * best;
  } else if (root->son[0]->sum + root->val >= root->son[1]->l.second &&
             root->son[0]->sum + root->val >= root->son[1]->r.second) {
    result +=
        1.0 * (1 << (h - depth - 1)) * max(best, root->son[0]->sum + root->val);
    Solve(root->son[0], node << 1, nowleft, mid, depth + 1,
          max(best, root->son[1]->sum + root->val));
  } else if (root->son[1]->sum + root->val >= root->son[0]->l.second &&
             root->son[1]->sum + root->val >= root->son[0]->r.second) {
    result +=
        1.0 * (1 << (h - depth - 1)) * max(best, root->son[1]->sum + root->val);
    Solve(root->son[1], (node << 1) | 1, mid + 1, nowright, depth + 1,
          max(best, root->son[0]->sum + root->val));
  }
  return;
}
int main() {
  int i, j, v, e;
  char flag;
  srand((unsigned)time(0));
  memory[++vs] = Type();
  root = &memory[vs];
  scanf("%d%d\n", &h, &q);
  n = 1 << h;
  for (i = 1; i <= q; i++) {
    scanf("%c", &flag);
    if (flag == 'a') {
      scanf("dd%d%d\n", &v, &e);
      tp = 0;
      for (j = h; j >= 0; j--)
        if ((1 << j) & v) {
          break;
        }
      for (j--; j >= 0; j--) {
        sk[tp++] = (v >> j) & 1;
      }
      Update(root, 1, 1, n, v, e, 0);
    } else {
      scanf("ecay\n");
      result = 0;
      Solve(root, 1, 1, n, 0, 0);
      printf("%.10lf\n", result / n);
    }
  }
  return 0;
}
