#include <bits/stdc++.h>
using namespace std;
struct node {
  node *l, *r, *p;
  int sum, val;
  node() {
    l = r = p = NULL;
    sum = val = 0;
  }
  void makesons() {
    l = new node();
    r = new node();
    l->p = r->p = this;
    l->update();
    r->update();
  }
  void update() {
    sum = val;
    if (p) sum += p->val;
    if (l) {
      sum += l->sum + r->sum - 2 * val;
    }
  }
};
node* root;
void add(unsigned int num, int val) {
  unsigned int tmp = 1;
  while (tmp <= num && tmp < (1u << 31)) tmp *= 2;
  if (tmp != num) tmp >>= 1;
  tmp >>= 1;
  node* v = root;
  for (; tmp; tmp >>= 1) {
    if (!v->l) v->makesons();
    if (num & tmp)
      v = v->r;
    else
      v = v->l;
  }
  v->val += val;
  if (v->l) {
    v->l->update();
    v->r->update();
  }
  for (; v; v = v->p) v->update();
}
double calc() {
  node* v = root;
  int val = 0;
  double ans = 0;
  double prob = 1;
  node *l, *r;
  while (true) {
    if (!v->l) return ans + prob * max(v->sum - (v->p ? v->p->val : 0), val);
    l = v->l;
    r = v->r;
    if (l->sum > r->sum) swap(l, r);
    if (r->sum <= val) return ans + prob * val;
    prob /= 2;
    ans += prob * r->sum;
    val = max(val, l->sum);
    v = r;
  }
}
int main() {
  root = new node;
  int q, h;
  scanf("%d %d", &h, &q);
  for (int i = 0; i < q; i++) {
    unsigned int num;
    int e;
    if (scanf(" add %u %d", &num, &e) == 2) {
      add(num, e);
    } else {
      scanf(" decay");
      double tmp = calc();
      printf("%.15lf\n", double(tmp));
    }
  }
  return 0;
}
