#include <bits/stdc++.h>
template <class T>
void inline checkMax(T &a, T b) {
  if (a < b) a = b;
};
struct Node {
  int v, sum;
  Node *left, *right;
  Node() {
    v = sum = 0;
    left = right = NULL;
  }
};
Node *root;
void addNode(int idx, int v) {
  Node *curr = root;
  int height = 31 - __builtin_clz(idx);
  for (int h = 0; h <= height; ++h) {
    curr->sum += v;
    if (h == height) {
      curr->v += v;
      return;
    }
    if (idx & (1 << (height - h - 1))) {
      if (curr->right == NULL) curr->right = new Node();
      curr = curr->right;
    } else {
      if (curr->left == NULL) curr->left = new Node();
      curr = curr->left;
    }
  }
}
double getProbabilit(int prev, double prob, Node *curr) {
  if (curr == NULL || curr->sum == 0) return prev * prob;
  int lv = curr->v, rv = curr->v;
  if (curr->left != NULL) lv += curr->left->sum;
  if (curr->right != NULL) rv += curr->right->sum;
  if (prev >= lv && prev >= rv) {
    return prev * prob;
  }
  double ret = 0;
  if (lv > rv) {
    ret = prob / 2 * lv;
    checkMax(prev, rv);
    ret += getProbabilit(prev, prob / 2, curr->left);
  } else {
    ret = prob / 2 * rv;
    checkMax(prev, lv);
    ret += getProbabilit(prev, prob / 2, curr->right);
  }
  return ret;
}
int main() {
  int h, Q;
  root = new Node();
  while (scanf("%d%d", &h, &Q) == 2) {
    for (int n_ = (Q), iq = 0; iq < n_; ++iq) {
      char operation[100];
      scanf("%s", operation);
      if (*operation == 'a') {
        int idx, a;
        scanf("%d%d", &idx, &a);
        if (a) addNode(idx, a);
      } else {
        printf("%.10f\n", getProbabilit(0, 1.0, root));
      }
    }
  }
  return 0;
}
