#include <bits/stdc++.h>
using namespace std;
struct Node {
  Node() {
    left = right = 0;
    cnt = 0;
    sum = 0;
  }
  Node* left;
  Node* right;
  int cnt;
  int sum;
};
int H;
char cmd[10];
double Calc(Node* node, double soFar) {
  if (!node) return soFar;
  if (node->sum < soFar + 1e-8) return soFar;
  double left = max(
      (double)(node->left ? node->left->sum : 0) + node->cnt,
      Calc(node->right,
           max(soFar, (double)(node->left ? node->left->sum : 0) + node->cnt)));
  double right = max(
      (double)(node->right ? node->right->sum : 0) + node->cnt,
      Calc(node->left, max(soFar, (double)(node->right ? node->right->sum : 0) +
                                      node->cnt)));
  if (left < soFar) left = soFar;
  if (right < soFar) right = soFar;
  return (left + right) / 2;
}
void AddIt(Node* node, int from, int to, int dest, int val) {
  if (from + 1 == to) {
    assert(from == dest && to - 1 == dest);
    node->cnt += val;
  } else {
    int m = (from + to) / 2;
    if (dest < m) {
      if (!node->left) node->left = new Node();
      AddIt(node->left, from, m, dest, val);
    } else {
      if (!node->right) node->right = new Node();
      AddIt(node->right, m, to, dest, val);
    }
  }
  node->sum = (node->left ? node->left->sum : 0) +
              (node->right ? node->right->sum : 0) + node->cnt;
}
int main(int argc, char* argv[]) {
  Node* root = new Node();
  int Q;
  scanf("%d %d", &H, &Q);
  while (Q--) {
    scanf("%s", &cmd);
    if (cmd[0] == 'a') {
      int pos, val;
      scanf("%d %d", &pos, &val);
      int base = 1;
      while (base * 2LL <= pos) base *= 2;
      AddIt(root, 0, base, pos - base, val);
    } else {
      double res = Calc(root, 0);
      printf("%.9lf\n", res);
    }
  }
  return 0;
}
