#include <bits/stdc++.h>
using namespace std;
int H, Q;
class Node;
Node* root;
class Node {
 public:
  Node() {
    sum = value = 0;
    parent = left = right = 0;
  }
  Node* Right() {
    if (right) return right;
    right = new Node();
    right->parent = this;
    return right;
  }
  Node* Left() {
    if (left) return left;
    left = new Node();
    left->parent = this;
    return left;
  }
  int nsum(Node* node) {
    if (!node) return 0;
    return node->sum;
  }
  void add(int e) {
    value += e;
    Node* cur;
    cur = this;
    while (cur) {
      cur->sum += e;
      cur = cur->parent;
    }
  }
  double rec(int om) {
    if (om >= sum) return om;
    double leftExp = Left()->rec(max(om, value + Right()->sum));
    double rightExp = Right()->rec(max(om, value + Left()->sum));
    return (leftExp + rightExp) / 2.0;
  }
  int sum, value;
  Node *left, *right, *parent;
};
Node* newnode() { return new Node(); }
Node* route(int k) {
  Node* cur = root;
  int mask = 1 << 30;
  while ((k & mask) == 0) {
    mask >>= 1;
  }
  mask >>= 1;
  while (mask) {
    bool right = ((k & mask) != 0);
    if (right)
      cur = cur->Right();
    else
      cur = cur->Left();
    mask >>= 1;
  }
  return cur;
}
int main() {
  root = newnode();
  cin >> H >> Q;
  string cmd;
  for (int i = 0; i < Q; ++i) {
    cin >> cmd;
    if (cmd == "add") {
      int v, e;
      cin >> v >> e;
      Node* node = route(v);
      node->add(e);
    } else if (cmd == "decay") {
      printf("%.9lf\n", root->rec(0));
    } else {
      cout << "BADCMD: " << cmd << endl;
      assert(0);
    }
  }
  return 0;
}
