#include char tree[10001]; char inp[10001]; int n; void dfs(int x) { if (x>=(1<