#include <bits/stdc++.h>
using namespace std;
template <class T>
void show(T a, int n) {
  for (int i = 0; i < n; ++i) cout << a[i] << ' ';
  cout << endl;
}
template <class T>
void show(T a, int r, int l) {
  for (int i = 0; i < r; ++i) show(a[i], l);
  cout << endl;
}
const int N = 32;
const int M = 110000;
const int oo = 10000 * 10000 * 10;
inline int L(int r) { return r + r; }
inline int R(int r) { return r + r + 1; }
int n, m;
map<int, int> apl;
double run(int r, int h, int ap) {
  if (h == n) return (ap > apl[r] ? ap : apl[r]);
  if (apl[r] <= ap) return (double(1 << (n - h)) * ap);
  return run(r * 2, h + 1,
             (ap > apl[r] - apl[L(r)] ? ap : apl[r] - apl[L(r)])) +
         run(r * 2 + 1, h + 1,
             (ap > apl[r] - apl[R(r)] ? ap : apl[r] - apl[R(r)]));
}
double delay() {
  int i, j, k;
  int r = 1;
  double ans = 0;
}
int main() {
  int i, j, cas = 0;
  char tag[22];
  scanf("%d %d", &n, &m);
  while (m--) {
    scanf("%s", tag);
    if (tag[0] == 'a') {
      int u, c;
      scanf("%d %d", &u, &c);
      while (u) {
        apl[u] += c;
        u /= 2;
      }
    } else {
      double ans = run(1, 0, -oo) / (1 << n);
      printf("%0.10f\n", ans);
    }
  }
  return 0;
}
