#include <bits/stdc++.h>
using namespace std;
map<long long, long long> m;
long long H;
double halfDecay(long long root, long long h, long long potential) {
  if (h == H) {
    return max(m[root], potential);
  }
  if (potential >= m[root]) return potential;
  int left = 2 * root;
  int right = left + 1;
  return 0.5 * (halfDecay(left, h + 1, max(m[root] - m[left], potential)) +
                halfDecay(right, h + 1, max(m[root] - m[right], potential)));
}
void solve() {
  cin >> H;
  long long q;
  cin >> q;
  while (q--) {
    string type;
    cin >> type;
    if (type == "add") {
      long long node, charge;
      cin >> node >> charge;
      while (node > 0) {
        m[node] += charge;
        node /= 2;
      }
    } else {
      cout << fixed << setprecision(10) << halfDecay(1, 0, 0) << endl;
    }
  }
}
int main() { solve(); }
