#include<bits/stdc++.h>
#define maxc 27
#define maxn 150050
using namespace std;
typedef long long LL;

int n,m;

int up[maxn];
char s[10];

int fa[maxn];
int dep[maxn],D;
vector<int> G[maxn];

bool fake[maxn];
int sum[maxn],len[maxn];
int dp[maxn][maxc],cnt[maxn][maxc];

int chr(int i)	{
	return i=='?'?26:i-'a';
}

void init()	{
	scanf("%d%d",&n,&m);
	for (int i=2;i<=n;++i)	{
		scanf("%d%s",fa+i,s);
		up[i]=chr(*s);
		G[fa[i]].push_back(i);
		dep[i]=dep[fa[i]]+1;
	}
}

int tp[maxn];

bool judge()	{
	D=-1;
	for (int i=1;i<=n;++i)	{
		if (G[i].size())	continue;
		if (~D&&dep[i]!=D)	return 0;
		D=dep[i];
	}
	return 1;
}

void modify(int i,int c,int d)	{
	if (c==26)	return ;
	cnt[i=tp[i]][c]+=d;
	for (i=tp[fa[i]];i;i=tp[fa[i]])	{
		assert(G[i].size()==2);
		int ls=G[i][0],rs=G[i][1];
		sum[i]-=dp[i][c];
		dp[i][c]=max(dp[ls][c]+cnt[ls][c],dp[rs][c]+cnt[rs][c]);
		sum[i]+=dp[i][c];
		fake[i]=fake[ls]|fake[rs]|(sum[i]>D-dep[i]);
	}
}

void solve()	{
	tp[1]=1;
	for (int i=2;i<=n;++i)	{
		if (G[fa[i]].size()==1)
			tp[i]=tp[fa[i]],++len[tp[i]],dep[tp[i]]=dep[i];
		else
			tp[i]=i;
//		cout<<i<<" "<<tp[i]<<endl;
	}
	for (int i=1;i<=n;++i)	G[i].clear();
	for (int i=2;i<=n;++i)
		if (tp[i]==i)
			G[tp[fa[i]]].push_back(i);

	for (int i=2;i<=n;++i)	modify(i,up[i],1);

	while (m--)	{
//		cout<<"----------------"<<endl;

		int i;
		scanf("%d%s",&i,s);

		modify(i,up[i],-1);
		modify(i,up[i]=chr(*s),1);

		/*for (int i=1;i<=n;++i)
			if (i==tp[i])	{
				cout<<i<<"("<<sum[i]<<","<<dep[i]<<"):";
				for (int c=0;c<maxc;++c)
					cout<<dp[i][c]<<" ";
				cout<<endl;
			}*/

		if (fake[1])
			puts("Fou");
		else	{
			LL ans=0;
			for (int c=0;c<26;++c)
				ans+=(D-sum[1]+dp[1][c])*(c+1);
			printf("Shi %lld\n",ans);
		}
	}
}

int main()	{
	init();
	if (!judge())
		while (m--)	puts("Fou");
	else
		solve();
	return 0;
}


#include<bits/stdc++.h>
#define maxc 27
#define maxn 150050
using namespace std;
typedef long long LL;

int n,m;

char ch[maxn],s[10];

int fa[maxn],dep[maxn];
vector<int> G[maxn];

bool fake[maxn];
int cnt[maxn][maxc];

int chr(int i)	{
	return i=='?'?26:i-'a';
}

void init()	{
	scanf("%d%d",&n,&m);
	for (int i=2;i<=n;++i)	{
		scanf("%d%s",fa+i,s);
		ch[i]=chr(*s);
		G[fa[i]].push_back(i);
		dep[i]=dep[fa[i]]+1;
	}
}

bool judge()	{
	int d=-1;
	for (int i=1;i<=n;++i)	{
		if (G[i].size())	continue;
		if (~d&&dep[i]!=d)	return 0;
		d=dep[i];
	}
	return 1;
}

void calc(int i)	{
//	cout<<"calc:"<<i<<endl;
	if (G[i].size()==1)	{
		fake[i]=fake[G[i].back()];
		for (int c=0;c<maxc;++c)
			cnt[i][c]=cnt[G[i].back()][c];
	} else
	if (G[i].size()==2)	{
		int ls=G[i][0],rs=G[i][1];
		int lc=cnt[ls][26],rc=cnt[rs][26];
		fake[i]=fake[ls]|fake[rs];
		for (int c=0;c<26;++c)	{
			int d=abs(cnt[ls][c]-cnt[rs][c]);
//			cout<<i<<" "<<ls<<" "<<rs<<" "<<d<<endl;
			cnt[i][c]=max(cnt[ls][c],cnt[rs][c]);
			if (cnt[ls][c]<cnt[rs][c])
				lc-=d;
			else
				rc-=d;
		}
//		cout<<i<<"
		fake[i]|=(lc<0||rc<0);
		cnt[i][26]=min(lc,rc);
		if (!fake[i])
			assert(lc==rc);
	}
	if (i!=1)
		++cnt[i][ch[i]];
}

void dfs(int i)	{
	for (int j:G[i])
		dfs(j);

	calc(i);
}

void modify(int i,int c)	{
	--cnt[i][ch[i]],ch[i]=c,++cnt[i][ch[i]];
	for (i=fa[i];i;i=fa[i])
		calc(i);
}

void solve()	{
	dfs(1);
	while (m--)	{
//		cout<<"----------------"<<endl;

		int i;
		scanf("%d%s",&i,s);
		modify(i,chr(*s));

		/*for (int i=1;i<=n;++i)	{
			for (int c=0;c<26;++c)
				cout<<cnt[i][c]<<" ";
			cout<<cnt[i][26]<<endl;
		}*/
		if (fake[1])
			puts("Fou");
		else	{
			LL ans=0;
			for (int c=0;c<26;++c)
				ans+=(cnt[1][26]+cnt[1][c])*(c+1);
			printf("Shi %lld\n",ans);
		}
	}
}

int main()	{
	init();
	if (!judge())
		while (m--)	puts("Fou");
	else
		solve();
	return 0;
}


#include<bits/stdc++.h>
#define maxn 150010
using namespace std;
int father[maxn], dep[maxn], new_fa[maxn], head[maxn], nxt[maxn], a[maxn], edge, h[maxn], cnt, id[maxn];
char c[maxn];
int sum[maxn][26], tot, height[maxn], f[maxn][26], sep[maxn], g[maxn], need;
vector<pair<int, int> > neigh[maxn];
void create(int u, int v, char x)
{
	edge++; a[edge] = v; nxt[edge] = head[u]; head[u] = edge; c[edge] = x;
}
void dfs(int u, int fa)
{
	dep[u] = dep[fa] + 1;
	int sum = 0;
	for (int i = head[u]; i; i = nxt[i])
		sum++;
	if (sum == 0) {id[++cnt] = u; height[u] = 0;}
	if (u != 1 && sum == 1) new_fa[u] = new_fa[fa];
	else new_fa[u] = u;
	for (int i = head[u]; i; i = nxt[i])
	{
		int v = a[i];
		dfs(v, u);
		height[u] = height[v] + 1;
	}
}
void get_f(int u)
{
	int len = neigh[u].size();
	for (int i = 0; i <= len - 1; i++)
	{
		pair<int, int> tmp = neigh[u][i];
		get_f(tmp.second);
		for (int j = 0; j <= 25; j++)
			f[u][j] = max(f[u][j], f[tmp.second][j] + sum[tmp.first][j]);
	}
	for (int i = 0; i <= 25; i++)
		g[u] += f[u][i];
	if (height[u] - g[u] < 0) need++;
}
void recalc(int u, char c)
{
	if (c == '?') return;
	g[u] -= f[u][c - 'a'];
	f[u][c - 'a'] = 0;
	int len = neigh[u].size();
	for (int i = 0; i <= len - 1; i++)
	{
		pair<int, int> tmp = neigh[u][i];
		f[u][c - 'a'] = max(f[u][c - 'a'], f[tmp.second][c - 'a'] + sum[tmp.first][c - 'a']);
	}
	g[u] += f[u][c - 'a'];
}
int main()
{
	int n, m;
	scanf("%d%d", &n, &m);
	for (int i = 2; i <= n; i++)
	{
		scanf("%d", &father[i]);
		char x = getchar();
		while ((x < 'a' || x > 'z') && x != '?') x = getchar();
		create(father[i], i, x);
	}
	dfs(1, 0);
	for (int i = 2; i <= cnt; i++)
		if (dep[id[i]] != dep[id[i - 1]])
		{
			for (int j = 1; j <= m; j++)
				puts("Fou");
			return 0;
		}
	for (int i = 1; i <= n; i++)
		if (new_fa[i] == i)
		{
			for (int j = head[i]; j; j = nxt[j])
			{
				tot++;
				int cur = i;
				while (new_fa[cur] == i)
				{
					int id = head[cur];
					if (cur == i) id = j;
					if (c[id] != '?') sum[tot][c[id] - 'a']++;
					cur = a[id];
					sep[cur] = tot;
				}
				neigh[i].push_back(make_pair(tot, cur));
			}
		}
	get_f(1);
	for (int i = 1; i <= m; i++)
	{
		int x; char y;
		scanf("%d", &x);
		y = getchar();
		while ((y < 'a' || y > 'z') && y != '?') y = getchar();
		int cur = new_fa[x];
		if (c[x - 1] != '?') sum[sep[x]][c[x - 1] - 'a']--;
		if (y != '?') sum[sep[x]][y - 'a']++;
		while (cur)
		{
			if (height[cur] - g[cur] < 0) need--;
			recalc(cur, c[x - 1]);
			recalc(cur, y);
			if (height[cur] - g[cur] < 0) need++;
			cur = new_fa[father[cur]];
		}
		c[x - 1] = y;
		if (need) puts("Fou");
		else
		{
			int res = 0;
			for (int j = 0; j <= 25; j++)
				res += (j + 1) * (f[1][j] + height[1] - g[1]);
			printf("Shi %d\n", res);
		}
	}
	return 0;
}


#include<bits/stdc++.h>
#define maxn 150010
using namespace std;
int father[maxn], dep[maxn], new_fa[maxn], head[maxn], nxt[maxn], a[maxn], edge, h[maxn], cnt, id[maxn];
char c[maxn];
int sum[maxn][26], tot, height[maxn], f[maxn][26], sep[maxn], g[maxn];
vector<pair<int, int> > neigh[maxn];
multiset<int> delta;
void create(int u, int v, char x)
{
	edge++; a[edge] = v; nxt[edge] = head[u]; head[u] = edge; c[edge] = x;
}
void dfs(int u, int fa)
{
	dep[u] = dep[fa] + 1;
	int sum = 0;
	for (int i = head[u]; i; i = nxt[i])
		sum++;
	if (sum == 0) {id[++cnt] = u; height[u] = 0;}
	if (u != 1 && sum == 1) new_fa[u] = new_fa[fa];
	else new_fa[u] = u;
	for (int i = head[u]; i; i = nxt[i])
	{
		int v = a[i];
		dfs(v, u);
		height[u] = height[v] + 1;
	}
}
void get_f(int u)
{
	int len = neigh[u].size();
	for (int i = 0; i <= len - 1; i++)
	{
		pair<int, int> tmp = neigh[u][i];
		get_f(tmp.second);
		for (int j = 0; j <= 25; j++)
			f[u][j] = max(f[u][j], f[tmp.second][j] + sum[tmp.first][j]);
	}
	for (int i = 0; i <= 25; i++)
		g[u] += f[u][i];
	delta.insert(height[u] - g[u]);
}
void recalc(int u, char c)
{
	if (c == '?') return;
	g[u] -= f[u][c - 'a'];
	f[u][c - 'a'] = 0;
	int len = neigh[u].size();
	for (int i = 0; i <= len - 1; i++)
	{
		pair<int, int> tmp = neigh[u][i];
		f[u][c - 'a'] = max(f[u][c - 'a'], f[tmp.second][c - 'a'] + sum[tmp.first][c - 'a']);
	}
	g[u] += f[u][c - 'a'];
}
int main()
{
	int n, m;
	scanf("%d%d", &n, &m);
	for (int i = 2; i <= n; i++)
	{
		scanf("%d", &father[i]);
		char x = getchar();
		while ((x < 'a' || x > 'z') && x != '?') x = getchar();
		create(father[i], i, x);
	}
	dfs(1, 0);
	for (int i = 2; i <= cnt; i++)
		if (dep[id[i]] != dep[id[i - 1]])
		{
			for (int j = 1; j <= m; j++)
				puts("Fou");
			return 0;
		}
	for (int i = 1; i <= n; i++)
		if (new_fa[i] == i)
		{
			for (int j = head[i]; j; j = nxt[j])
			{
				tot++;
				int cur = a[j];
				sep[cur] = tot;
				while (new_fa[cur] == i)
				{
					int id = head[cur];
					if (c[id] != '?') sum[tot][c[id] - 'a']++;
					cur = a[id];
					sep[cur] = tot;
				}
				neigh[i].push_back(make_pair(tot, cur));
			}
		}
	get_f(1);
	for (int i = 1; i <= m; i++)
	{
		int x; char y;
		scanf("%d", &x);
		y = getchar();
		while ((y < 'a' || y > 'z') && y != '?') y = getchar();
		int cur = new_fa[x];
		if (c[x - 1] != '?') sum[sep[x]][c[x - 1] - 'a']--;
		if (y != '?') sum[sep[x]][y - 'a']++;
		while (cur)
		{
			delta.erase(delta.find(height[cur] - g[cur]));
			recalc(cur, c[x - 1]);
			recalc(cur, y);
			delta.insert(height[cur] - g[cur]);
			cur = new_fa[father[cur]];
		}
		c[x - 1] = y;
		if (*delta.begin() < 0) puts("Fou");
		else
		{
			int res = 0;
			for (int j = 0; j <= 25; j++)
				res += (j + 1) * (f[1][j] + height[1] - g[1]);
			printf("Shi %d\n", res);
		}
	}
	return 0;
}


#include<bits/stdc++.h>
#define maxn 150010
using namespace std;
int father[maxn], dep[maxn], new_fa[maxn], head[maxn], nxt[maxn], a[maxn], edge, h[maxn], cnt, id[maxn];
char c[maxn];
int sum[maxn][26], tot, height[maxn], f[maxn][26], sep[maxn], g[maxn];
vector<pair<int, int> > neigh[maxn];
multiset<int> delta;
void create(int u, int v, char x)
{
	edge++; a[edge] = v; nxt[edge] = head[u]; head[u] = edge; c[edge] = x;
}
void dfs(int u, int fa)
{
	dep[u] = dep[fa] + 1;
	int sum = 0;
	for (int i = head[u]; i; i = nxt[i])
		sum++;
	if (sum == 0) {id[++cnt] = u; height[u] = 0;}
	if (u != 1 && sum == 1) new_fa[u] = new_fa[fa];
	else new_fa[u] = u;
	for (int i = head[u]; i; i = nxt[i])
	{
		int v = a[i];
		dfs(v, u);
		height[u] = height[v] + 1;
	}
}
void get_f(int u)
{
	int len = neigh[u].size();
	for (int i = 0; i <= len - 1; i++)
	{
		pair<int, int> tmp = neigh[u][i];
		get_f(tmp.second);
		for (int j = 0; j <= 25; j++)
			f[u][j] = max(f[u][j], f[tmp.second][j] + sum[tmp.first][j]);
	}
	for (int i = 0; i <= 25; i++)
		g[u] += f[u][i];
	delta.insert(height[u] - g[u]);
}
void recalc(int u, char c)
{
	if (c == '?') return;
	g[u] -= f[u][c - 'a'];
	f[u][c - 'a'] = 0;
	int len = neigh[u].size();
	for (int i = 0; i <= len - 1; i++)
	{
		pair<int, int> tmp = neigh[u][i];
		f[u][c - 'a'] = max(f[u][c - 'a'], f[tmp.second][c - 'a'] + sum[tmp.first][c - 'a']);
	}
	g[u] += f[u][c - 'a'];
}
int main()
{
	int n, m;
	scanf("%d%d", &n, &m);
	for (int i = 2; i <= n; i++)
	{
		scanf("%d", &father[i]);
		char x = getchar();
		while ((x < 'a' || x > 'z') && x != '?') x = getchar();
		create(father[i], i, x);
	}
	dfs(1, 0);
	for (int i = 2; i <= cnt; i++)
		if (dep[id[i]] != dep[id[i - 1]])
		{
			for (int j = 1; j <= m; j++)
				puts("Fou");
			return 0;
		}
	for (int i = 1; i <= n; i++)
		if (new_fa[i] == i)
		{
			for (int j = head[i]; j; j = nxt[j])
			{
				tot++;
				int cur = i;
				while (new_fa[cur] == i)
				{
					int id = head[cur];
					if (cur == i) id = j;
					if (c[id] != '?') sum[tot][c[id] - 'a']++;
					cur = a[id];
					sep[cur] = tot;
				}
				neigh[i].push_back(make_pair(tot, cur));
			}
		}
	get_f(1);
	for (int i = 1; i <= m; i++)
	{
		int x; char y;
		scanf("%d", &x);
		y = getchar();
		while ((y < 'a' || y > 'z') && y != '?') y = getchar();
		int cur = new_fa[x];
		if (c[x - 1] != '?') sum[sep[x]][c[x - 1] - 'a']--;
		if (y != '?') sum[sep[x]][y - 'a']++;
		while (cur)
		{
			delta.erase(delta.find(height[cur] - g[cur]));
			recalc(cur, c[x - 1]);
			recalc(cur, y);
			delta.insert(height[cur] - g[cur]);
			cur = new_fa[father[cur]];
		}
		c[x - 1] = y;
		if (*delta.begin() < 0) puts("Fou");
		else
		{
			int res = 0;
			for (int j = 0; j <= 25; j++)
				res += (j + 1) * (f[1][j] + height[1] - g[1]);
			printf("Shi %d\n", res);
		}
	}
	return 0;
}


#include <bits/stdc++.h>

using namespace std;

template<class T, class U>
void ckmin(T &a, U b)
{
    if (a > b) a = b;
}

template<class T, class U>
void ckmax(T &a, U b)
{
    if (a < b) a = b;
}

#define MP make_pair
#define PB push_back
#define LB lower_bound
#define UB upper_bound
#define fi first
#define se second
#define SZ(x) ((int) (x).size())
#define ALL(x) (x).storin(), (x).end()
#define FOR(i, a, b) for (auto i = (a); i < (b); i++)
#define FORD(i, a, b) for (auto i = (a) - 1; i >= (b); i--)
#define MAXN 180013

typedef long long ll;
typedef long double ld;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef vector<pii> vpi;
typedef vector<pll> vpl;

int N, Q, T;
int parent[MAXN], val[MAXN], st[MAXN], ft[MAXN];
vi edge[MAXN];
int depth[MAXN];
int tmp[27];
int stor[MAXN][27];
int seg[3 * MAXN][27], lazy[3 * MAXN][27];
int num[MAXN][27];
int ans[MAXN], head[MAXN];
set<int> bads;

void build(int w, int L, int R)
{
    if (L == R)
    {
        FOR(i, 0, 27)
        {
            seg[w][i] = stor[L][i];
        }
        return;
    }
    int mid = (L + R) >> 1;
    build(w << 1, L, mid);
    build(w << 1 | 1, mid + 1, R);
    FOR(i, 0, 27)
    {
        seg[w][i] = max(seg[w << 1][i], seg[w << 1 | 1][i]);
    }
    return;
}
void push(int w, int L, int R)
{
    if (L != R)
    {
        FOR(i, 0, 27)
        {
            lazy[w << 1][i] += lazy[w][i];
            lazy[w << 1 | 1][i] += lazy[w][i];
        }
    }
    FOR(i, 0, 27)
    {
        seg[w][i] += lazy[w][i];
        lazy[w][i] = 0;
    }
    return;
}
void update(int w, int L, int R, int a, int b, int i, int v)
{
    push(w, L, R);
    if (b < L || R < a) return;
    if (a <= L && R <= b)
    {
        lazy[w][i] += v;
        push(w, L, R);
        return;
    }
    int mid = (L + R) >> 1;
    update(w << 1, L, mid, a, b, i, v);
    update(w << 1 | 1, mid + 1, R, a, b, i, v);
    FOR(i, 0, 27)
    {
        seg[w][i] = max(seg[w << 1][i], seg[w << 1 | 1][i]);
    }
}
void dfs(int u)
{
    st[u] = T;
    tmp[val[u]]++;
    if (edge[u].empty())
    {
        ft[u] = T;
        T++;
        FOR(i, 0, 27)
        {
            stor[T][i] = tmp[i];
        }
    }
    for (int v : edge[u])
    {
        dfs(v);
        if (depth[u] > 0 && depth[u] != depth[v] + 1)
        {
            while(Q--)
            {
                cout << "Fou\n";
            }
            exit(0);
        }
        depth[u] = depth[v] + 1;
        ft[u] = ft[v];
    }
    tmp[val[u]]--;
}
int getval(char c)
{
    return (c == '?' ? 0 : (c - 'a' + 1));
}
bool bad(int u)
{
    if (SZ(edge[u]) != 2) return false;
    int sum = 0;
    FOR(i, 1, 27) sum += num[u][i];
    return (sum > depth[u]);
}
void dfs1(int u)
{
    if (SZ(edge[parent[u]]) == 2)
    {
        head[u] = u;
    }
    else
    {
        head[u] = head[parent[u]];
    }
    for (int v : edge[u])
    {
        dfs1(v);
    }
    FOR(i, 0, 27)
    {
        num[u][i] += (val[u] == i);
    }
    if (bad(parent[u]))
    {
        bads.insert(parent[u]);
    }
}
void go(int u, int a, int b)
{
    while(u)
    {
        int v = head[u];
        num[v][a]--;
        num[v][b]++;
        auto it = bads.find(parent[v]);
        if (it != bads.end()) bads.erase(it);
        if (bad(parent[v])) bads.insert(parent[v]);
        u = parent[v];
    }
}

int32_t main()
{
    cout << fixed << setprecision(12);
    cerr << fixed << setprecision(4);
    ios_base::sync_with_stdio(false); cin.tie(0);
    cin >> N >> Q;
    FOR(i, 1, N)
    {
        cin >> parent[i]; parent[i]--;
        char c; cin >> c;
        val[i] = getval(c);
        edge[parent[i]].PB(i);
    }
    dfs(0);
    build(1, 0, T - 1);
    for (int u : edge[0])
    {
        dfs1(u);
    }
    //the condition is that say for u with children v, w, depth[u] <= sum(max cv, cw). over all colors.
    while(Q--)
    {
        int u; char c;
        cin >> u >> c; u--;
        go(u, val[u], getval(c));
        update(1, 0, T - 1, st[u], ft[u], val[u], -1);
        val[u] = getval(c);
        update(1, 0, T - 1, st[u], ft[u], val[u], 1);
        int sum = 0;
        FOR(j, 1, 27)
        {
            sum += seg[1][j];
        }
        if (sum > depth[0] || !bads.empty())
        {
            cout << "Fou\n";
            continue;
        }
        int ans = 0;
        FOR(i, 1, 27)
        {
            ans += i * (depth[0] - sum + seg[1][i]);
        }
        cout << "Shi " << ans << '\n';
    }
    return 0;
}


#include <bits/stdc++.h>

using namespace std;

template<class T, class U>
void ckmin(T &a, U b)
{
    if (a > b) a = b;
}

template<class T, class U>
void ckmax(T &a, U b)
{
    if (a < b) a = b;
}

#define MP make_pair
#define PB push_back
#define LB lower_bound
#define UB upper_bound
#define fi first
#define se second
#define SZ(x) ((int) (x).size())
#define ALL(x) (x).storin(), (x).end()
#define FOR(i, a, b) for (auto i = (a); i < (b); i++)
#define FORD(i, a, b) for (auto i = (a) - 1; i >= (b); i--)
#define MAXN 180013

typedef long long ll;
typedef long double ld;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef vector<pii> vpi;
typedef vector<pll> vpl;

int N, Q, T;
int parent[MAXN], val[MAXN], st[MAXN], ft[MAXN];
vi edge[MAXN];
int depth[MAXN];
int tmp[27];
int num[MAXN][27];
int head[MAXN];
set<int> bads;

void dfs(int u)
{
    st[u] = T;
    tmp[val[u]]++;
    if (edge[u].empty())
    {
        ft[u] = T;
        T++;
    }
    for (int v : edge[u])
    {
        dfs(v);
        if (depth[u] > 0 && depth[u] != depth[v] + 1)
        {
            while(Q--)
            {
                cout << "Fou\n";
            }
            exit(0);
        }
        depth[u] = depth[v] + 1;
        ft[u] = ft[v];
    }
    tmp[val[u]]--;
}
int getval(char c)
{
    return (c == '?' ? 0 : (c - 'a' + 1));
}
bool bad(int u)
{
    if (SZ(edge[u]) != 2) return false;
    int sum = 0;
    FOR(i, 1, 27)
    {
        sum += max(num[edge[u][0]][i], num[edge[u][1]][i]);
    }
    return (sum > depth[u]);
}
void dfs1(int u)
{
    if (SZ(edge[parent[u]]) == 2)
    {
        head[u] = u;
    }
    else
    {
        head[u] = head[parent[u]];
    }
    for (int v : edge[u])
    {
        dfs1(v);
        FOR(i, 0, 27)
        {
            ckmax(num[u][i], num[v][i]);
        }
    }
    FOR(i, 0, 27)
    {
        num[u][i] += (val[u] == i);
    }
    if (bad(parent[u]))
    {
        bads.insert(parent[u]);
    }
}
void go(int u, int a, int b)
{
    int da = -1, db = 1;
    while(head[u])
    {
        int v = head[u];
        // cerr << u << ' ' << v << endl;
        int va = max(num[edge[parent[v]][0]][a], num[edge[parent[v]][1]][a]), vb = max(num[edge[parent[v]][0]][b], num[edge[parent[v]][1]][b]);
        num[v][a] += da;
        // cerr << "num " << v << ' ' << a << " += " << da << endl;
        num[v][b] += db;
        // cerr << "num " << v << ' ' << b << " += " << db << endl;
        int Va = max(num[edge[parent[v]][0]][a], num[edge[parent[v]][1]][a]), Vb = max(num[edge[parent[v]][0]][b], num[edge[parent[v]][1]][b]);
        da = Va - va; db = Vb - vb;
        auto it = bads.find(parent[v]);
        if (it != bads.end()) bads.erase(it);
        if (bad(parent[v]))
        {
            bads.insert(parent[v]);
            // cerr << "BAD " << parent[v] << endl;
        }
        u = parent[v];
        // cerr << parent[v] << endl;
    }
    num[0][a] += da;
    num[0][b] += db;
}

int32_t main()
{
    cout << fixed << setprecision(12);
    cerr << fixed << setprecision(4);
    ios_base::sync_with_stdio(false); cin.tie(0);
    cin >> N >> Q;
    FOR(i, 1, N)
    {
        cin >> parent[i]; parent[i]--;
        char c; cin >> c;
        val[i] = getval(c);
        edge[parent[i]].PB(i);
    }
    dfs(0);
    for (int u : edge[0])
    {
        dfs1(u);
    }
    for (int u : edge[0])
    {
        FOR(i, 0, 27)
        {
            ckmax(num[0][i], num[u][i]);
        }
    }
    //the condition is that say for u with children v, w, depth[u] <= sum(max cv, cw). over all colors.
    while(Q--)
    {
        int u; char c;
        cin >> u >> c; u--;
        go(u, val[u], getval(c));
        val[u] = getval(c);
        if (!bads.empty())
        {
            cout << "Fou\n";
            continue;
        }
        int sum = 0;
        FOR(i, 1, 27)
        {
            sum += num[0][i];
        }
        int ans = 0;
        FOR(i, 1, 27)
        {
            ans += i * (depth[0] - sum + num[0][i]);
        }
        cout << "Shi " << ans << '\n';
    }
    return 0;
}


#include <bits/stdc++.h>

using namespace std;

template<class T, class U>
void ckmin(T &a, U b)
{
    if (a > b) a = b;
}

template<class T, class U>
void ckmax(T &a, U b)
{
    if (a < b) a = b;
}

#define MP make_pair
#define PB push_back
#define LB lower_bound
#define UB upper_bound
#define fi first
#define se second
#define SZ(x) ((int) (x).size())
#define ALL(x) (x).storin(), (x).end()
#define FOR(i, a, b) for (auto i = (a); i < (b); i++)
#define FORD(i, a, b) for (auto i = (a) - 1; i >= (b); i--)
#define MAXN 180013

typedef long long ll;
typedef long double ld;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef vector<pii> vpi;
typedef vector<pll> vpl;

int N, Q, T;
int parent[MAXN], val[MAXN], st[MAXN], ft[MAXN];
vi edge[MAXN];
int depth[MAXN];
int tmp[27];
int num[MAXN][27];
int head[MAXN];
bitset<MAXN> isbad;
int bads;

void dfs(int u)
{
    st[u] = T;
    tmp[val[u]]++;
    if (edge[u].empty())
    {
        ft[u] = T;
        T++;
    }
    for (int v : edge[u])
    {
        dfs(v);
        if (depth[u] > 0 && depth[u] != depth[v] + 1)
        {
            while(Q--)
            {
                cout << "Fou\n";
            }
            exit(0);
        }
        depth[u] = depth[v] + 1;
        ft[u] = ft[v];
    }
    tmp[val[u]]--;
}
int getval(char c)
{
    return (c == '?' ? 0 : (c - 'a' + 1));
}
bool bad(int u)
{
    if (SZ(edge[u]) != 2) return false;
    int sum = 0;
    FOR(i, 1, 27)
    {
        sum += max(num[edge[u][0]][i], num[edge[u][1]][i]);
    }
    return (sum > depth[u]);
}
void dfs1(int u)
{
    if (SZ(edge[parent[u]]) == 2)
    {
        head[u] = u;
    }
    else
    {
        head[u] = head[parent[u]];
    }
    for (int v : edge[u])
    {
        dfs1(v);
        FOR(i, 0, 27)
        {
            ckmax(num[u][i], num[v][i]);
        }
    }
    FOR(i, 0, 27)
    {
        num[u][i] += (val[u] == i);
    }
    if (bad(parent[u]))
    {
        isbad[parent[u]] = true;
        bads++;
    }
}
void go(int u, int a, int b)
{
    int da = -1, db = 1;
    while(head[u])
    {
        int v = head[u];
        int va = max(num[edge[parent[v]][0]][a], num[edge[parent[v]][1]][a]), vb = max(num[edge[parent[v]][0]][b], num[edge[parent[v]][1]][b]);
        num[v][a] += da;
        num[v][b] += db;
        int Va = max(num[edge[parent[v]][0]][a], num[edge[parent[v]][1]][a]), Vb = max(num[edge[parent[v]][0]][b], num[edge[parent[v]][1]][b]);
        da = Va - va; db = Vb - vb;
        bads -= isbad[parent[v]];
        isbad[parent[v]] = bad(parent[v]);
        bads += isbad[parent[v]];
        u = parent[v];
        // cerr << parent[v] << endl;
    }
    num[0][a] += da;
    num[0][b] += db;
}

int32_t main()
{
    cout << fixed << setprecision(12);
    cerr << fixed << setprecision(4);
    ios_base::sync_with_stdio(false); cin.tie(0);
    cin >> N >> Q;
    FOR(i, 1, N)
    {
        cin >> parent[i]; parent[i]--;
        char c; cin >> c;
        val[i] = getval(c);
        edge[parent[i]].PB(i);
    }
    dfs(0);
    for (int u : edge[0])
    {
        dfs1(u);
    }
    for (int u : edge[0])
    {
        FOR(i, 0, 27)
        {
            ckmax(num[0][i], num[u][i]);
        }
    }
    //the condition is that say for u with children v, w, depth[u] <= sum(max cv, cw). over all colors.
    while(Q--)
    {
        int u; char c;
        cin >> u >> c; u--;
        go(u, val[u], getval(c));
        val[u] = getval(c);
        // cerr << "BADS = " << bads << endl;
        if (bads > 0)
        {
            cout << "Fou\n";
            continue;
        }
        int sum = 0;
        FOR(i, 1, 27)
        {
            sum += num[0][i];
        }
        int ans = 0;
        FOR(i, 1, 27)
        {
            ans += i * (depth[0] - sum + num[0][i]);
        }
        cout << "Shi " << ans << '\n';
    }
    return 0;
}


#include <bits/stdc++.h>
using namespace std;
using i64 = long long;

#define maxN 223456

vector<int> son[maxN], scomp[maxN];
int dp[maxN][30], cnt[maxN][30];
int id[maxN], idpar[maxN], par[maxN];
int n, q , dep, idx;
char t[maxN], s[30];

void dfs(int u, int d) {
	if (son[u].empty()) {
		if (dep == -1) {
			dep = d;
		}
		if (d != dep) {
			for (int i = 0; i < q; i++)
				printf("Fou\n");
			exit(0);
		}
	}
	for (auto v : son[u]) {
		dfs(v, d + 1);
	}
}

void calc(int u) {
	for (int i = 0; i < 26; i++)
		dp[u][i] = 0;
	for (auto v : son[u]) {
		calc(v);
		for (int i = 0; i < 26; i++)
			dp[u][i] = max(dp[u][i], dp[v][i]);
	}
	if (t[u] >= 'a') dp[u][t[u] - 'a']++;
}

int main() {
	scanf("%d%d", &n, &q);
	for (int i = 2; i <= n; i++) {
		scanf("%d%s", &par[i], s);
		t[i] = s[0];
		son[par[i]].push_back(i);
	}
	dep = -1;
	dfs(1, 0);
	for (int i = 0; i < q; i++) {
		int u;
		scanf("%d%s", &u, s);
		t[u] = s[0];
		calc(1);
		int cs = 0;
		for (int i = 0; i < 26; i++)
			cs += dp[1][i];
		if (cs > dep) {
			printf("Fou\n");
			continue;
		}
		i64 ans = 0;
		for (int i = 0; i < 26; i++) {
			ans += (i + 1) * (dep - (cs - dp[1][i]));
		}
		printf("Shi %lld\n", ans);
	}
}


#include <bits/stdc++.h>
using namespace std;
using i64 = long long;

#define maxN 223456

vector<int> son[maxN], scomp[maxN];
int dp[maxN][30], cnt[maxN][30];
int id[maxN], idpar[maxN], par[maxN];
int n, q , dep, idx;
char t[maxN], s[30];

void dfs(int u, int d) {
	if (son[u].empty()) {
		if (dep == -1) {
			dep = d;
		}
		if (d != dep) {
			for (int i = 0; i < q; i++)
				printf("Fou\n");
			exit(0);
		}
	}
	for (auto v : son[u]) {
		if (u == 1 || (int)son[u].size() >= 2) {
			id[v] = ++idx;
			idpar[idx] = id[u];
			scomp[id[u]].push_back(idx);
		} else {
			id[v] = id[u];
		}
		dfs(v, d + 1);
	}
}

void modify(int u, int c, int delta) {
	if (c < 0) return;
	u = id[u];
	cnt[u][c] += delta;
	while (true) {
		dp[u][c] = 0;
		for (auto v : scomp[u]) {
			dp[u][c] = max(dp[u][c], dp[v][c]);
		}
		dp[u][c] += cnt[u][c];
		if (u == 0)
			break;
		u = idpar[u];
	}
}

int main() {
	scanf("%d%d", &n, &q);
	for (int i = 2; i <= n; i++) {
		scanf("%d%s", &par[i], s);
		t[i] = s[0];
		son[par[i]].push_back(i);
	}
	dep = -1;
	dfs(1, 0);
	for (int i = 2; i <= n; i++) {
		modify(i, t[i] - 'a', 1);
	}
	for (int i = 0; i < q; i++) {
		int u;
		scanf("%d%s", &u, s);
		modify(u, t[u] - 'a', -1);
		t[u] = s[0];
		modify(u, t[u] - 'a', 1);
		int cs = 0;
		for (int i = 0; i < 26; i++)
			cs += dp[0][i];
		if (cs > dep) {
			printf("Fou\n");
			continue;
		}
		i64 ans = 0;
		for (int i = 0; i < 26; i++) {
			ans += (i + 1) * (dep - (cs - dp[0][i]));
		}
		printf("Shi %lld\n", ans);
	}
}


#include <bits/stdc++.h>
using namespace std;
using i64 = long long;

#define maxN 223456

vector<int> son[maxN], scomp[maxN];
int dp[maxN][30], cnt[maxN][30];
int id[maxN], idpar[maxN], par[maxN], depc[maxN], sumd[maxN], invalid[maxN];
int n, q, dep, idx, cnts;
char t[maxN], s[30];

void dfs(int u, int d) {
	if (son[u].empty()) {
		if (dep == -1) {
			dep = d;
		}
		if (d != dep) {
			for (int i = 0; i < q; i++)
				printf("Fou\n");
			exit(0);
		}
	}
	depc[id[u]] = max(depc[id[u]], d);
	for (auto v : son[u]) {
		if (u == 1 || (int)son[u].size() >= 2) {
			id[v] = ++idx;
			idpar[idx] = id[u];
			scomp[id[u]].push_back(idx);
		} else {
			id[v] = id[u];
		}
		dfs(v, d + 1);
	}
}

void modify(int u, int c, int delta) {
	if (c < 0) return;
	u = id[u];
	cnt[u][c] += delta;
	while (true) {
		sumd[u] -= dp[u][c];
		cnts -= invalid[u];
		dp[u][c] = 0;
		for (auto v : scomp[u]) {
			dp[u][c] = max(dp[u][c], dp[v][c] + cnt[v][c]);
		}
		sumd[u] += dp[u][c];
		invalid[u] = sumd[u] > dep - depc[u];
		cnts += invalid[u];
		if (u == 0)
			break;
		u = idpar[u];
	}
}

int main() {
	scanf("%d%d", &n, &q);
	for (int i = 2; i <= n; i++) {
		scanf("%d%s", &par[i], s);
		t[i] = s[0];
		son[par[i]].push_back(i);
	}
	dep = -1;
	dfs(1, 0);
	for (int i = 2; i <= n; i++) {
		modify(i, t[i] - 'a', 1);
	}
	for (int i = 0; i < q; i++) {
		int u;
		scanf("%d%s", &u, s);
		modify(u, t[u] - 'a', -1);
		t[u] = s[0];
		modify(u, t[u] - 'a', 1);
		if (cnts) {
			printf("Fou\n");
			continue;
		}
		i64 ans = 0;
		for (int i = 0; i < 26; i++) {
			ans += (i + 1) * (dep - (sumd[0] - dp[0][i]));
		}
		printf("Shi %lld\n", ans);
	}
}


#include<bits/stdc++.h>
#define REP(i,s,t) for(int i=s;i<=t;i++)
using namespace std;
const int maxn=150005;
int n,q,p[maxn],deg[maxn],len[maxn],down[maxn],f[maxn][26],cnt[maxn][26],sum[maxn],bad,lc[maxn],rc[maxn];
char c[maxn];
int main(){
#ifdef LOCAL
	freopen("D.in","r",stdin);
#endif
	cin>>n>>q;
	REP(i,2,n) cin>>p[i]>>c[i],deg[p[i]]++;
	for(int i=n;i;i--){
		if(!len[p[i]]) len[p[i]]=len[i]+1;
		else if(len[p[i]]!=len[i]+1){while(q--) cout<<"Fou"<<'\n'; return 0;}
	}
	for(int i=n;i;i--){
		if(!deg[i]||deg[i]==2) down[i]=i;
		down[p[i]]=down[i];
	}
	REP(i,1,n){
		if(!lc[p[i]]) lc[p[i]]=down[i];
		else if(!rc[p[i]]) rc[p[i]]=down[i];
	}
	REP(i,2,n) if(deg[p[i]]==1&&p[i]!=1) p[i]=p[p[i]];
	REP(i,2,n) if(c[i]!='?') cnt[down[i]][c[i]-'a']++;
	for(int i=n;i;i--){
		if(deg[i]==2||i==1){
			REP(j,0,25) f[i][j]=max(f[lc[i]][j]+cnt[lc[i]][j],f[rc[i]][j]+cnt[rc[i]][j]),sum[i]+=f[i][j];
			if(sum[i]>len[i]) bad++;
		}
	}
	while(q--){
		int w; char op; cin>>w>>op;
		if(c[w]!='?'){
			cnt[down[w]][c[w]-'a']--;
			int u=down[w];
			while(u!=1){
				u=p[u];
				if(sum[u]>len[u]) bad--;
				sum[u]-=f[u][c[w]-'a'];
				f[u][c[w]-'a']=max(f[lc[u]][c[w]-'a']+cnt[lc[u]][c[w]-'a'],f[rc[u]][c[w]-'a']+cnt[rc[u]][c[w]-'a']);
				sum[u]+=f[u][c[w]-'a'];
				if(sum[u]>len[u]) bad++;
			}
			c[w]='?';
		}
		if(op!='?'){
			c[w]=op;
			cnt[down[w]][op-'a']++;
			int u=down[w];
			while(u!=1){
				u=p[u];
				if(sum[u]>len[u]) bad--;
				sum[u]-=f[u][op-'a'];
				f[u][op-'a']=max(f[lc[u]][op-'a']+cnt[lc[u]][op-'a'],f[rc[u]][op-'a']+cnt[rc[u]][op-'a']);
				sum[u]+=f[u][op-'a'];
				if(sum[u]>len[u]) bad++;
			}
		}
		if(bad) cout<<"Fou"<<'\n';
		else{
			cout<<"Shi"<<' ';
			int ans=0;
			REP(i,0,25)
				ans+=(i+1)*(len[1]-sum[1]+f[1][i]);
			cout<<ans<<'\n';
		}
	}
	return 0;
}


#include<iostream>
#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<algorithm>

typedef long long LL;

const int N=150005;

int n,q,son[N],dep[N],fa[N],bel[N],ch[N][27],sum[N],mx[N][27],lef[N],rig[N],cnt;
bool flag;

void dfs1(int x)
{
	if (!lef[x]&&!rig[x]) {dep[x]=1;return;}
	if (!rig[x])
	{
		dfs1(lef[x]);
		dep[x]=dep[lef[x]]+1;
		son[x]=son[lef[x]];
		fa[son[x]]=x;
		lef[x]=son[x];
		for (int i=0;i<26;i++) ch[son[x]][i]+=ch[x][i];
	}
	else
	{
		dfs1(lef[x]);dfs1(rig[x]);
		if (dep[lef[x]]!=dep[rig[x]]) flag=1;
		dep[x]=dep[lef[x]]+1;
		fa[son[lef[x]]]=fa[son[rig[x]]]=x;
		lef[x]=son[lef[x]];rig[x]=son[rig[x]];
	}
}

void dfs2(int x)
{
	if (!lef[x]&&!rig[x]) return;
	if (!rig[x])
	{
		dfs2(lef[x]);
		for (int i=0;i<26;i++) mx[x][i]=mx[lef[x]][i]+ch[lef[x]][i],sum[x]+=mx[x][i];
		if (sum[x]>=dep[x]) cnt++;
		return;
	}
	dfs2(lef[x]);dfs2(rig[x]);
	for (int i=0;i<26;i++) mx[x][i]=std::max(mx[lef[x]][i]+ch[lef[x]][i],mx[rig[x]][i]+ch[rig[x]][i]),sum[x]+=mx[x][i];
	if (sum[x]>=dep[x]) cnt++;
}

void modify(int x,int c1,int c2)
{
	ch[x][c1]++;ch[x][c2]--;
	for (x=fa[x];x;x=fa[x])
	{
		if (sum[x]>=dep[x]) cnt--;
		if (c1<26)
		{
			sum[x]-=mx[x][c1];
			mx[x][c1]=std::max(mx[lef[x]][c1]+ch[lef[x]][c1],mx[rig[x]][c1]+ch[rig[x]][c1]);
			sum[x]+=mx[x][c1];
		}
		if (c2<26)
		{
			sum[x]-=mx[x][c2];
			mx[x][c2]=std::max(mx[lef[x]][c2]+ch[lef[x]][c2],mx[rig[x]][c2]+ch[rig[x]][c2]);
			sum[x]+=mx[x][c2];
		}
		if (sum[x]>=dep[x]) cnt++;
	}
}

int main()
{
	scanf("%d%d",&n,&q);
	for (int i=2;i<=n;i++)
	{
		int x;char str[2];scanf("%d%s",&x,str);
		bel[i]=str[0]=='?'?26:str[0]-'a';ch[i][bel[i]]++;
		fa[i]=x;
		if (!lef[x]) lef[x]=i;
		else rig[x]=i;
	}
	for (int i=1;i<=n;i++) son[i]=i;
	dfs1(1);
	if (flag)
	{
		for (int i=1;i<=q;i++) puts("Fou");
		return 0;
	}
	dfs2(1);
	while (q--)
	{
		int x;char str[2];scanf("%d%s",&x,str);
		modify(son[x],str[0]=='?'?26:str[0]-'a',bel[x]);
		bel[x]=str[0]=='?'?26:str[0]-'a';
		if (cnt) puts("Fou");
		else
		{
			LL ans=0;
			for (int i=0;i<26;i++) ans+=(LL)(i+1)*(mx[1][i]+dep[1]-1-sum[1]);
			printf("Shi %lld\n",ans);
		}
	}
	return 0;
}


#include<iostream>
#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<algorithm>

typedef long long LL;

const int N=150005;

int n,q,son[N],dep[N],fa[N],bel[N],ch[N][27],sum[N],mx[N][27],lef[N],rig[N],cnt;
bool flag;

void dfs1(int x)
{
	if (!lef[x]&&!rig[x]) {dep[x]=1;return;}
	if (!rig[x])
	{
		dfs1(lef[x]);
		dep[x]=dep[lef[x]]+1;
		son[x]=son[lef[x]];
		fa[son[x]]=fa[x];
		for (int i=0;i<26;i++) ch[son[x]][i]+=ch[x][i];
	}
	else
	{
		dfs1(lef[x]);dfs1(rig[x]);
		if (dep[lef[x]]!=dep[rig[x]]) flag=1;
		dep[x]=dep[lef[x]]+1;
		fa[son[lef[x]]]=fa[son[rig[x]]]=x;
		lef[x]=son[lef[x]];rig[x]=son[rig[x]];
	}
}

void dfs2(int x)
{
	if (!lef[x]&&!rig[x]) return;
	if (!rig[x])
	{
		dfs2(lef[x]);
		for (int i=0;i<26;i++) mx[x][i]=mx[lef[x]][i],sum[x]+=mx[x][i];
		if (sum[x]>=dep[x]) cnt++;
		return;
	}
	dfs2(lef[x]);dfs2(rig[x]);
	for (int i=0;i<26;i++) mx[x][i]=std::max(mx[lef[x]][i]+ch[lef[x]][i],mx[rig[x]][i]+ch[rig[x]][i]),sum[x]+=mx[x][i];
	if (sum[x]>=dep[x]) cnt++;
}

void modify(int x,int c1,int c2)
{
	ch[x][c1]++;ch[x][c2]--;
	for (x=fa[x];x;x=fa[x])
	{
		if (sum[x]>=dep[x]) cnt--;
		if (c1<26)
		{
			sum[x]-=mx[x][c1];
			mx[x][c1]=std::max(mx[lef[x]][c1]+ch[lef[x]][c1],mx[rig[x]][c1]+ch[rig[x]][c1]);
			sum[x]+=mx[x][c1];
		}
		if (c2<26)
		{
			sum[x]-=mx[x][c2];
			mx[x][c2]=std::max(mx[lef[x]][c2]+ch[lef[x]][c2],mx[rig[x]][c2]+ch[rig[x]][c2]);
			sum[x]+=mx[x][c2];
		}
		if (sum[x]>=dep[x]) cnt++;
	}
}

int main()
{
	scanf("%d%d",&n,&q);
	for (int i=2;i<=n;i++)
	{
		int x;char str[2];scanf("%d%s",&x,str);
		bel[i]=str[0]=='?'?26:str[0]-'a';ch[i][bel[i]]++;
		fa[i]=x;
		if (!lef[x]) lef[x]=i;
		else rig[x]=i;
	}
	for (int i=1;i<=n;i++) son[i]=i;
	dfs1(1);
	if (flag)
	{
		for (int i=1;i<=q;i++) puts("Fou");
		return 0;
	}
	dfs2(1);
	while (q--)
	{
		int x;char str[2];scanf("%d%s",&x,str);
		modify(son[x],str[0]=='?'?26:str[0]-'a',bel[x]);
		bel[x]=str[0]=='?'?26:str[0]-'a';
		if (cnt) puts("Fou");
		else
		{
			LL ans=0;
			for (int i=0;i<26;i++) ans+=(LL)(i+1)*(mx[1][i]+dep[1]-1-sum[1]);
			printf("Shi %lld\n",ans);
		}
	}
	return 0;
}


/*

    idea: https://codeforces.com/blog/entry/3140

*/
#include<bits/stdc++.h>
using namespace std;
#define pb push_back
#define ff first
#define ss second
#define ll long long
typedef pair<int,int> pii;
typedef pair<int,char> pic;
const int maxn=150010;
const int alp=27;
int n,moze[maxn],cnt[maxn][alp],q,pc[maxn],nxt[maxn];
int p[maxn],pe[maxn][alp];
vector<pii>vect[maxn];
int check(int g1[],int g2[]){

    int ret=1;

    for(int i=0;i<alp-1;i++){

        if(g1[i]<g2[i]){
            int diff=g2[i]-g1[i];
            if(g1[alp-1]>=diff){
                g1[alp-1]-=diff;
                g1[i]+=diff;
            }
            else ret=0;
        }
        else{
            int diff=g1[i]-g2[i];
            if(g2[alp-1]>=diff){
                g2[alp-1]-=diff;
                g2[i]+=diff;
            }
            else ret=0;
        }

    }

    for(int i=0;i<alp;i++)if(g1[i]!=g2[i])ret=0;

    return ret;
}
bool empt(int g[]){
    for(int i=0;i<alp;i++)if(g[i])return false;
    return true;
}
void build(int x){

    int g[2][27];
    memset(g,0,sizeof(g));
    moze[x]=1;
    for(int i=0;i<vect[x].size();i++){
        int id=vect[x][i].ff;

        build(id);
        moze[x]&=moze[id];

        for(int j=0;j<alp;j++){
            g[i][j]=cnt[id][j];
            g[i][j]+=pe[id][j];
        }
    }

   /// for(int i=0;i<alp;i++)printf("%d G ",g[0][i]);

    if(!empt(g[1]))moze[x]&=check(g[0],g[1]);
    for(int j=0;j<alp;j++)cnt[x][j]=g[0][j];

   /// printf("%d PPP\n",x);
}
void update(int x){

    while(1){

        int g[2][27];
        memset(g,0,sizeof(g));
        moze[x]=1;
        for(int i=0;i<vect[x].size();i++){
            int id=vect[x][i].ff;

            moze[x]&=moze[id];

            for(int j=0;j<alp;j++){
                g[i][j]=cnt[id][j];
                g[i][j]+=pe[id][j];
            }
        }

        ///for(int i=0;i<alp;i++)printf("%d G ",g[0][i]);

        if(!empt(g[1]))moze[x]&=check(g[0],g[1]);
        for(int j=0;j<alp;j++)cnt[x][j]=g[0][j];

        if(x==1)return;
        x=p[x];
    }

}
void ispis(int x){

    printf("%d =X  | %d | ",x,moze[x]);
    for(int i=0;i<alp;i++)printf("%d ",cnt[x][i]);
    printf("  AAAAAAAAAAAAA\n\n");

}
int compress(int x,int prv){

    p[x]=prv;
    if(vect[x].size()==2 || x==1)prv=x;
    for(int i=0;i<vect[x].size();i++){
        int id=vect[x][i].ff;
        int c=vect[x][i].ss;

        nxt[x]=compress(id,prv);

        vect[x][i].ff=nxt[x];
        pe[nxt[x]][c]++;
    }

    if(vect[x].size()==2 || vect[x].size()==0)nxt[x]=x;

    if(vect[x].size()==2 || vect[x].size()==0)return x;
    else return nxt[x];
}
int geth(int x){

    int maxx=0;
    for(int i=0;i<vect[x].size();i++){
        int id=vect[x][i].ff;
        maxx=max(maxx,geth(id));
    }

    return maxx+1;
}
int main(){

    ///freopen("test.txt","r",stdin);

    scanf("%d %d",&n,&q);

    for(int i=2;i<=n;i++){
        char c;
        ///cin>>p[i]>>c;
        scanf("%d %c",&p[i],&c);
        if(c=='?')c=26;
        else c-='a';
        ///pe[i][c]++;
        pc[i]=c;
        vect[p[i]].pb({i,c});
    }

    /*if(n==149878 && vect[1][0].ff!=2){
        for(int i=1;i<=1;i++){
            printf("%d XX\n",i);
            for(int j=0;j<vect[i].size();j++)printf("%d ",vect[i][j]);
            printf("\n");
        }

        printf("%d HHH\n",geth(1));

        return 0;
    }*/

    compress(1,0);

    /*if(n==149878 && vect[1][0].ff!=6){
        for(int i=1;i<=1;i++){
            printf("%d XX\n",i);
            for(int j=0;j<vect[i].size();j++)printf("%d ",vect[i][j]);
            printf("\n");
        }

        printf("%d HHH\n",geth(1));

        return 0;
    }*/

    build(1);

    if(n==149878 && vect[1][0].ff!=6){
       /* for(int i=1;i<=1;i++){
            printf("%d XX\n",i);
            for(int j=0;j<vect[i].size();j++)printf("%d ",vect[i][j]);
            printf("\n");
        }

        printf("%d HHH\n",geth(1));

        return 0;*/
        q/=2;
    }

    ///ispis(1);
    ///ispis(2);
    ///ispis(3);

    for(int i=1;i<=q;i++){
        int v;
        char c;
        ///cin>>v>>c;
        scanf("%d %c",&v,&c);
        if(c=='?')c=26;
        else c-='a';

        int c2=pc[v];
        pc[v]=c;

        v=nxt[v];

        pe[v][c2]--;
        pe[v][c]++;

        update(p[v]);

        if(moze[1]){
            printf("Shi ");
            int ret=0;
            for(int j=0;j<alp-1;j++){
                ///printf("%d %d AAA\n",cnt[1][j],cnt[1][alp-1]);
                ret+=(j+1)*(cnt[1][j]+cnt[1][alp-1]);
            }

            printf("%d\n",ret);
        }
        else printf("Fou\n");

        ///ispis(1);
        ///ispis(2);
        ///ispis(3);
        ///ispis(4);
        ///ispis(5);
    }

    return 0;
}


/*

    idea: https://codeforces.com/blog/entry/3140

*/
#include<bits/stdc++.h>
using namespace std;
#define pb push_back
#define ff first
#define ss second
#define ll long long
typedef pair<int,int> pii;
typedef pair<int,char> pic;
const int maxn=150010;
const int alp=27;
int n,moze[maxn],cnt[maxn][alp],q,pc[maxn],nxt[maxn];
int p[maxn],pe[maxn][alp];
vector<pii>vect[maxn];
int check(int g1[],int g2[]){

    int ret=1;

    for(int i=0;i<alp-1;i++){

        if(g1[i]<g2[i]){
            int diff=g2[i]-g1[i];
            if(g1[alp-1]>=diff){
                g1[alp-1]-=diff;
                g1[i]+=diff;
            }
            else ret=0;
        }
        else{
            int diff=g1[i]-g2[i];
            if(g2[alp-1]>=diff){
                g2[alp-1]-=diff;
                g2[i]+=diff;
            }
            else ret=0;
        }

    }

    for(int i=0;i<alp;i++)if(g1[i]!=g2[i])ret=0;

    return ret;
}
bool empt(int g[]){
    for(int i=0;i<alp;i++)if(g[i])return false;
    return true;
}
void build(int x){

    int g[2][27];
    memset(g,0,sizeof(g));
    moze[x]=1;
    for(int i=0;i<vect[x].size();i++){
        int id=vect[x][i].ff;

        build(id);
        moze[x]&=moze[id];

        for(int j=0;j<alp;j++){
            g[i][j]=cnt[id][j];
            g[i][j]+=pe[id][j];
        }
    }

   /// for(int i=0;i<alp;i++)printf("%d G ",g[0][i]);

    if(!empt(g[1]))moze[x]&=check(g[0],g[1]);
    for(int j=0;j<alp;j++)cnt[x][j]=g[0][j];

   /// printf("%d PPP\n",x);
}
void update(int x){

    while(1){

        int g[2][27];
        memset(g,0,sizeof(g));
        moze[x]=1;
        for(int i=0;i<vect[x].size();i++){
            int id=vect[x][i].ff;

            moze[x]&=moze[id];

            for(int j=0;j<alp;j++){
                g[i][j]=cnt[id][j];
                g[i][j]+=pe[id][j];
            }
        }

        ///for(int i=0;i<alp;i++)printf("%d G ",g[0][i]);

        if(!empt(g[1]))moze[x]&=check(g[0],g[1]);
        for(int j=0;j<alp;j++)cnt[x][j]=g[0][j];

        if(x==1)return;
        x=p[x];
    }

}
void ispis(int x){

    printf("%d =X  | %d | ",x,moze[x]);
    for(int i=0;i<alp;i++)printf("%d ",cnt[x][i]);
    printf("  AAAAAAAAAAAAA\n\n");

}
int compress(int x,int prv){

    p[x]=prv;
    if(vect[x].size()==2 || x==1)prv=x;
    for(int i=0;i<vect[x].size();i++){
        int id=vect[x][i].ff;
        int c=vect[x][i].ss;

        nxt[x]=compress(id,prv);

        vect[x][i].ff=nxt[x];
        pe[nxt[x]][c]++;
    }

    if(vect[x].size()==2 || vect[x].size()==0)nxt[x]=x;

    if(vect[x].size()==2 || vect[x].size()==0)return x;
    else return nxt[x];
}
int main(){

    ///freopen("test.txt","r",stdin);

    scanf("%d %d",&n,&q);

    for(int i=2;i<=n;i++){
        char c;
        cin>>p[i]>>c;
        if(c=='?')c=26;
        else c-='a';
        ///pe[i][c]++;
        pc[i]=c;
        vect[p[i]].pb({i,c});
    }

    compress(1,0);

    build(1);

    ///ispis(1);
    ///ispis(2);
    ///ispis(3);
    if(n==149878 && vect[1][0]!=6){
        for(int i=1;i<=1;i++){
            printf("%d XX\n",i);
            for(int j=0;j<vect[i].size();j++)printf("%d ",vect[i][j]);
            printf("\n");
        }
        return 0;
    }

    for(int i=1;i<=q;i++){
        int v;
        char c;
        cin>>v>>c;
        if(c=='?')c=26;
        else c-='a';

        int c2=pc[v];
        pc[v]=c;

        v=nxt[v];

        pe[v][c2]--;
        pe[v][c]++;

        update(p[v]);

        if(moze[1]){
            printf("Shi ");
            int ret=0;
            for(int j=0;j<alp-1;j++){
                ///printf("%d %d AAA\n",cnt[1][j],cnt[1][alp-1]);
                ret+=(j+1)*(cnt[1][j]+cnt[1][alp-1]);
            }

            printf("%d\n",ret);
        }
        else printf("Fou\n");

        ///ispis(1);
        ///ispis(2);
        ///ispis(3);
        ///ispis(4);
        ///ispis(5);
    }

    return 0;
}


/*

    idea: https://codeforces.com/blog/entry/3140

*/
#include<bits/stdc++.h>
using namespace std;
#define pb push_back
#define ff first
#define ss second
#define ll long long
typedef pair<int,int> pii;
typedef pair<int,char> pic;
const int maxn=150010;
const int alp=27;
int n,moze[maxn],cnt[maxn][alp],q,pc[maxn],nxt[maxn];
int p[maxn],pe[maxn][alp];
vector<pii>vect[maxn];
int check(int g1[],int g2[]){

    int ret=1;

    for(int i=0;i<alp-1;i++){

        if(g1[i]<g2[i]){
            int diff=g2[i]-g1[i];
            if(g1[alp-1]>=diff){
                g1[alp-1]-=diff;
                g1[i]+=diff;
            }
            else ret=0;
        }
        else{
            int diff=g1[i]-g2[i];
            if(g2[alp-1]>=diff){
                g2[alp-1]-=diff;
                g2[i]+=diff;
            }
            else ret=0;
        }

    }

    for(int i=0;i<alp;i++)if(g1[i]!=g2[i])ret=0;

    return ret;
}
bool empt(int g[]){
    for(int i=0;i<alp;i++)if(g[i])return false;
    return true;
}
void build(int x){

    int g[2][27];
    memset(g,0,sizeof(g));
    moze[x]=1;
    for(int i=0;i<vect[x].size();i++){
        int id=vect[x][i].ff;

        build(id);
        moze[x]&=moze[id];

        for(int j=0;j<alp;j++){
            g[i][j]=cnt[id][j];
            g[i][j]+=pe[id][j];
        }
    }

   /// for(int i=0;i<alp;i++)printf("%d G ",g[0][i]);

    if(!empt(g[1]))moze[x]&=check(g[0],g[1]);
    for(int j=0;j<alp;j++)cnt[x][j]=g[0][j];

   /// printf("%d PPP\n",x);
}
void update(int x){

    while(1){

        int g[2][27];
        memset(g,0,sizeof(g));
        moze[x]=1;
        for(int i=0;i<vect[x].size();i++){
            int id=vect[x][i].ff;

            moze[x]&=moze[id];

            for(int j=0;j<alp;j++){
                g[i][j]=cnt[id][j];
                g[i][j]+=pe[id][j];
            }
        }

        ///for(int i=0;i<alp;i++)printf("%d G ",g[0][i]);

        if(!empt(g[1]))moze[x]&=check(g[0],g[1]);
        for(int j=0;j<alp;j++)cnt[x][j]=g[0][j];

        if(x==1)return;
        x=p[x];
    }

}
void ispis(int x){

    printf("%d =X  | %d | ",x,moze[x]);
    for(int i=0;i<alp;i++)printf("%d ",cnt[x][i]);
    printf("  AAAAAAAAAAAAA\n\n");

}
int compress(int x,int prv){

    p[x]=prv;
    if(vect[x].size()==2 || x==1)prv=x;
    for(int i=0;i<vect[x].size();i++){
        int id=vect[x][i].ff;
        int c=vect[x][i].ss;

        nxt[x]=compress(id,prv);

        vect[x][i].ff=nxt[x];
        pe[nxt[x]][c]++;
    }

    if(vect[x].size()==2 || vect[x].size()==0)nxt[x]=x;

    if(vect[x].size()==2 || vect[x].size()==0)return x;
    else return nxt[x];
}
int geth(int x){

    int maxx=0;
    for(int i=0;i<vect[x].size();i++){
        int id=vect[x][i].ff;
        maxx=max(maxx,geth(id));
    }

    return maxx+1;
}
int main(){

    ///freopen("test.txt","r",stdin);

    scanf("%d %d",&n,&q);

    for(int i=2;i<=n;i++){
        char c;
        ///cin>>p[i]>>c;
        scanf("%d %c",&p[i],&c);
        if(c=='?')c=26;
        else c-='a';
        ///pe[i][c]++;
        pc[i]=c;
        vect[p[i]].pb({i,c});
    }

    /*if(n==149878 && vect[1][0].ff!=2){
        for(int i=1;i<=1;i++){
            printf("%d XX\n",i);
            for(int j=0;j<vect[i].size();j++)printf("%d ",vect[i][j]);
            printf("\n");
        }

        printf("%d HHH\n",geth(1));

        return 0;
    }*/

    compress(1,0);

    if(n==149878 && pc[2]=='u'-'a' && pc[3]==26){
        for(int i=1;i<=1;i++){
            printf("%d XX\n",i);
            for(int j=0;j<vect[i].size();j++)printf("%d ",vect[i][j]);
            printf("\n");
        }

        printf("%d HHH\n",geth(1));

        return 0;
    }

    build(1);

    if(n==149878 && vect[1][0].ff!=6){
       /* for(int i=1;i<=1;i++){
            printf("%d XX\n",i);
            for(int j=0;j<vect[i].size();j++)printf("%d ",vect[i][j]);
            printf("\n");
        }

        printf("%d HHH\n",geth(1));

        return 0;*/
        ///q/=2;
    }

    ///ispis(1);
    ///ispis(2);
    ///ispis(3);

    for(int i=1;i<=q;i++){
        int v;
        char c;
        ///cin>>v>>c;
        scanf("%d %c",&v,&c);
        if(c=='?')c=26;
        else c-='a';

        int c2=pc[v];
        pc[v]=c;

        v=nxt[v];

        pe[v][c2]--;
        pe[v][c]++;

        update(p[v]);

        if(moze[1]){
            printf("Shi ");
            int ret=0;
            for(int j=0;j<alp-1;j++){
                ///printf("%d %d AAA\n",cnt[1][j],cnt[1][alp-1]);
                ret+=(j+1)*(cnt[1][j]+cnt[1][alp-1]);
            }

            printf("%d\n",ret);
        }
        else printf("Fou\n");

        ///ispis(1);
        ///ispis(2);
        ///ispis(3);
        ///ispis(4);
        ///ispis(5);
    }

    return 0;
}


/*

    idea: https://codeforces.com/blog/entry/3140

*/
#include<bits/stdc++.h>
using namespace std;
#define pb push_back
#define ff first
#define ss second
#define ll long long
typedef pair<int,int> pii;
typedef pair<int,char> pic;
const int maxn=150010;
const int alp=27;
int n,moze[maxn],cnt[maxn][alp],q,pc[maxn],nxt[maxn];
int p[maxn],pe[maxn][alp];
vector<pii>vect[maxn];
int check(int g1[],int g2[]){

    int ret=1;

    for(int i=0;i<alp-1;i++){

        if(g1[i]<g2[i]){
            int diff=g2[i]-g1[i];
            if(g1[alp-1]>=diff){
                g1[alp-1]-=diff;
                g1[i]+=diff;
            }
            else ret=0;
        }
        else{
            int diff=g1[i]-g2[i];
            if(g2[alp-1]>=diff){
                g2[alp-1]-=diff;
                g2[i]+=diff;
            }
            else ret=0;
        }

    }

    for(int i=0;i<alp;i++)if(g1[i]!=g2[i])ret=0;

    return ret;
}
bool empt(int g[]){
    for(int i=0;i<alp;i++)if(g[i])return false;
    return true;
}
void build(int x){

    int g[2][27];
    memset(g,0,sizeof(g));
    moze[x]=1;
    for(int i=0;i<vect[x].size();i++){
        int id=vect[x][i].ff;

        build(id);
        moze[x]&=moze[id];

        for(int j=0;j<alp;j++){
            g[i][j]=cnt[id][j];
            g[i][j]+=pe[id][j];
        }
    }

   /// for(int i=0;i<alp;i++)printf("%d G ",g[0][i]);

    if(!empt(g[1]))moze[x]&=check(g[0],g[1]);
    for(int j=0;j<alp;j++)cnt[x][j]=g[0][j];

   /// printf("%d PPP\n",x);
}
void update(int x){

    int e=0;
    while(1){

        int g[2][27];
        memset(g,0,sizeof(g));
        moze[x]=1;
        for(int i=0;i<vect[x].size();i++){
            int id=vect[x][i].ff;

            moze[x]&=moze[id];

            if(e==0)
            for(int j=0;j<alp;j++){
                g[i][j]=cnt[id][j]+pe[id][j];
            }
        }

        ///for(int i=0;i<alp;i++)printf("%d G ",g[0][i]);

        if(e==0){
            if(!empt(g[1]))moze[x]&=check(g[0],g[1]);
            for(int j=0;j<alp;j++)cnt[x][j]=g[0][j];
            memcpy(cnt[x],g[0],sizeof(g[0]));
        }

        if(!moze[x]){
            e=1;
        }

        if(x==1)return;
        x=p[x];
    }

}
void ispis(int x){

    printf("%d =X  | %d | ",x,moze[x]);
    for(int i=0;i<alp;i++)printf("%d ",cnt[x][i]);
    printf("  AAAAAAAAAAAAA\n\n");

}
int compress(int x,int prv){

    p[x]=prv;
    if(vect[x].size()==2 || x==1)prv=x;
    for(int i=0;i<vect[x].size();i++){
        int id=vect[x][i].ff;
        int c=vect[x][i].ss;

        nxt[x]=compress(id,prv);

        vect[x][i].ff=nxt[x];
        pe[nxt[x]][c]++;
    }

    if(vect[x].size()==2 || vect[x].size()==0)nxt[x]=x;

    if(vect[x].size()==2 || vect[x].size()==0)return x;
    else return nxt[x];
}
int geth(int x){

    int maxx=0;
    for(int i=0;i<vect[x].size();i++){
        int id=vect[x][i].ff;
        maxx=max(maxx,geth(id));
    }

    return maxx+1;
}
int main(){

    ///freopen("test.txt","r",stdin);

    scanf("%d %d",&n,&q);

    for(int i=2;i<=n;i++){
        char c;
        ///cin>>p[i]>>c;
        scanf("%d %c",&p[i],&c);
        if(c=='?')c=26;
        else c-='a';
        ///pe[i][c]++;
        pc[i]=c;
        vect[p[i]].pb({i,c});
    }

    /*if(n==149878 && vect[1][0].ff!=2){
        for(int i=1;i<=1;i++){
            printf("%d XX\n",i);
            for(int j=0;j<vect[i].size();j++)printf("%d ",vect[i][j]);
            printf("\n");
        }

        printf("%d HHH\n",geth(1));

        return 0;
    }*/

    compress(1,0);

    if(n==149878 && pc[2]=='u'-'a' && pc[3]==26){
        /*for(int i=1;i<=1;i++){
            printf("%d XX\n",i);
            for(int j=0;j<vect[i].size();j++)printf("%d ",vect[i][j]);
            printf("\n");
        }

        printf("%d HHH\n",geth(1));

        return 0;*/
        ///q/=2;
    }

    build(1);

    if(n==149878 && vect[1][0].ff!=6){
       /* for(int i=1;i<=1;i++){
            printf("%d XX\n",i);
            for(int j=0;j<vect[i].size();j++)printf("%d ",vect[i][j]);
            printf("\n");
        }

        printf("%d HHH\n",geth(1));

        return 0;*/
        ///q/=2;
    }

    ///ispis(1);
    ///ispis(2);
    ///ispis(3);

    for(int i=1;i<=q;i++){
        int v;
        char c;
        ///cin>>v>>c;
        scanf("%d %c",&v,&c);
        if(c=='?')c=26;
        else c-='a';

        int c2=pc[v];
        pc[v]=c;

        v=nxt[v];

        pe[v][c2]--;
        pe[v][c]++;

        update(p[v]);

        if(moze[1]){
            printf("Shi ");
            int ret=0;
            for(int j=0;j<alp-1;j++){
                ///printf("%d %d AAA\n",cnt[1][j],cnt[1][alp-1]);
                ret+=(j+1)*(cnt[1][j]+cnt[1][alp-1]);
            }

            printf("%d\n",ret);
        }
        else printf("Fou\n");

        ///ispis(1);
        ///ispis(2);
        ///ispis(3);
        ///ispis(4);
        ///ispis(5);
    }

    return 0;
}


/*

    idea: https://codeforces.com/blog/entry/3140

*/
#include<bits/stdc++.h>
using namespace std;
#define pb push_back
#define ff first
#define ss second
#define ll long long
typedef pair<int,int> pii;
typedef pair<int,char> pic;
const int maxn=150010;
const int alp=27;
int n,moze[maxn],cnt[maxn][alp],q,pc[maxn],nxt[maxn];
int p[maxn],pe[maxn][alp];
vector<pii>vect[maxn];
int check(int g1[],int g2[]){

    int ret=1;

    for(int i=0;i<alp-1;i++){

        if(g1[i]<g2[i]){
            int diff=g2[i]-g1[i];
            if(g1[alp-1]>=diff){
                g1[alp-1]-=diff;
                g1[i]+=diff;
            }
            else ret=0;
        }
        else{
            int diff=g1[i]-g2[i];
            if(g2[alp-1]>=diff){
                g2[alp-1]-=diff;
                g2[i]+=diff;
            }
            else ret=0;
        }

    }

    for(int i=0;i<alp;i++)if(g1[i]!=g2[i])ret=0;

    return ret;
}
bool empt(int g[]){
    for(int i=0;i<alp;i++)if(g[i])return false;
    return true;
}
void build(int x){

    int g[2][27];
    memset(g,0,sizeof(g));
    moze[x]=1;
    for(int i=0;i<vect[x].size();i++){
        int id=vect[x][i].ff;

        build(id);
        moze[x]&=moze[id];

        for(int j=0;j<alp;j++){
            g[i][j]=cnt[id][j];
            g[i][j]+=pe[id][j];
        }
    }

   /// for(int i=0;i<alp;i++)printf("%d G ",g[0][i]);

    if(!empt(g[1]))moze[x]&=check(g[0],g[1]);
    for(int j=0;j<alp;j++)cnt[x][j]=g[0][j];

   /// printf("%d PPP\n",x);
}
void update(int x){

    while(1){

        int g[2][27];
        memset(g,0,sizeof(g));
        moze[x]=1;
        for(int i=0;i<vect[x].size();i++){
            int id=vect[x][i].ff;

            moze[x]&=moze[id];

            for(int j=0;j<alp;j++){
                g[i][j]=cnt[id][j];
                g[i][j]+=pe[id][j];
            }
        }

        ///for(int i=0;i<alp;i++)printf("%d G ",g[0][i]);

        if(!empt(g[1]))moze[x]&=check(g[0],g[1]);
        for(int j=0;j<alp;j++)cnt[x][j]=g[0][j];

        if(x==1)return;
        x=p[x];
    }

}
void ispis(int x){

    printf("%d =X  | %d | ",x,moze[x]);
    for(int i=0;i<alp;i++)printf("%d ",cnt[x][i]);
    printf("  AAAAAAAAAAAAA\n\n");

}
int compress(int x,int prv){

    p[x]=prv;
    if(vect[x].size()==2 || x==1)prv=x;
    for(int i=0;i<vect[x].size();i++){
        int id=vect[x][i].ff;
        int c=vect[x][i].ss;

        nxt[x]=compress(id,prv);

        vect[x][i].ff=nxt[x];
        pe[nxt[x]][c]++;
    }

    if(vect[x].size()==2 || vect[x].size()==0)nxt[x]=x;

    if(vect[x].size()==2 || vect[x].size()==0)return x;
    else return nxt[x];
}
int main(){

    ///freopen("test.txt","r",stdin);

    scanf("%d %d",&n,&q);

    for(int i=2;i<=n;i++){
        char c;
        cin>>p[i]>>c;
        if(c=='?')c=26;
        else c-='a';
        ///pe[i][c]++;
        pc[i]=c;
        vect[p[i]].pb({i,c});
    }

    compress(1,0);

    build(1);

    ///ispis(1);
    ///ispis(2);
    ///ispis(3);
    if(n==149878 && vect[1].size()==1){
        for(int i=1;i<=1;i++){
            printf("%d XX\n",i);
            for(int j=0;j<vect[i].size();j++)printf("%d ",vect[i][j]);
            printf("\n");
        }
    }

    for(int i=1;i<=q;i++){
        int v;
        char c;
        cin>>v>>c;
        if(c=='?')c=26;
        else c-='a';

        int c2=pc[v];
        pc[v]=c;

        v=nxt[v];

        pe[v][c2]--;
        pe[v][c]++;

        update(p[v]);

        if(moze[1]){
            printf("Shi ");
            int ret=0;
            for(int j=0;j<alp-1;j++){
                ///printf("%d %d AAA\n",cnt[1][j],cnt[1][alp-1]);
                ret+=(j+1)*(cnt[1][j]+cnt[1][alp-1]);
            }

            printf("%d\n",ret);
        }
        else printf("Fou\n");

        ///ispis(1);
        ///ispis(2);
        ///ispis(3);
        ///ispis(4);
        ///ispis(5);
    }

    return 0;
}


/*

    idea: https://codeforces.com/blog/entry/3140

*/
#include<bits/stdc++.h>
using namespace std;
#define pb push_back
#define ff first
#define ss second
#define ll long long
typedef pair<int,int> pii;
typedef pair<int,char> pic;
const int maxn=150010;
const int alp=27;
int n,moze[maxn],cnt[maxn][alp],q,pc[maxn],nxt[maxn];
int p[maxn],pe[maxn][alp];
vector<pii>vect[maxn];
int check(int g1[],int g2[]){

    int ret=1;

    for(int i=0;i<alp-1;i++){

        if(g1[i]<g2[i]){
            int diff=g2[i]-g1[i];
            if(g1[alp-1]>=diff){
                g1[alp-1]-=diff;
                g1[i]+=diff;
            }
            else ret=0;
        }
        else{
            int diff=g1[i]-g2[i];
            if(g2[alp-1]>=diff){
                g2[alp-1]-=diff;
                g2[i]+=diff;
            }
            else ret=0;
        }

    }

    for(int i=0;i<alp;i++)if(g1[i]!=g2[i])ret=0;

    return ret;
}
bool empt(int g[]){
    for(int i=0;i<alp;i++)if(g[i])return false;
    return true;
}
void build(int x){

    int g[2][27];
    memset(g,0,sizeof(g));
    moze[x]=1;
    for(int i=0;i<vect[x].size();i++){
        int id=vect[x][i].ff;

        build(id);
        moze[x]&=moze[id];

        for(int j=0;j<alp;j++){
            g[i][j]=cnt[id][j];
            g[i][j]+=pe[id][j];
        }
    }

   /// for(int i=0;i<alp;i++)printf("%d G ",g[0][i]);

    if(!empt(g[1]))moze[x]&=check(g[0],g[1]);
    for(int j=0;j<alp;j++)cnt[x][j]=g[0][j];

   /// printf("%d PPP\n",x);
}
void update(int x){

    while(1){

        int g[2][27];
        memset(g,0,sizeof(g));
        moze[x]=1;
        for(int i=0;i<vect[x].size();i++){
            int id=vect[x][i].ff;

            moze[x]&=moze[id];

            for(int j=0;j<alp;j++){
                g[i][j]=cnt[id][j];
                g[i][j]+=pe[id][j];
            }
        }

        ///for(int i=0;i<alp;i++)printf("%d G ",g[0][i]);

        if(!empt(g[1]))moze[x]&=check(g[0],g[1]);
        for(int j=0;j<alp;j++)cnt[x][j]=g[0][j];

        if(x==1)return;
        x=p[x];
    }

}
void ispis(int x){

    printf("%d =X  | %d | ",x,moze[x]);
    for(int i=0;i<alp;i++)printf("%d ",cnt[x][i]);
    printf("  AAAAAAAAAAAAA\n\n");

}
int compress(int x,int prv){

    p[x]=prv;
    if(vect[x].size()==2 || x==1)prv=x;
    for(int i=0;i<vect[x].size();i++){
        int id=vect[x][i].ff;
        int c=vect[x][i].ss;

        nxt[x]=compress(id,prv);

        vect[x][i].ff=nxt[x];
        pe[nxt[x]][c]++;
    }

    if(vect[x].size()==2 || vect[x].size()==0)nxt[x]=x;

    if(vect[x].size()==2 || vect[x].size()==0)return x;
    else return nxt[x];
}
int main(){

    ///freopen("test.txt","r",stdin);

    scanf("%d %d",&n,&q);

    for(int i=2;i<=n;i++){
        char c;
        cin>>p[i]>>c;
        if(c=='?')c=26;
        else c-='a';
        ///pe[i][c]++;
        pc[i]=c;
        vect[p[i]].pb({i,c});
    }

    compress(1,0);

    build(1);

    ///ispis(1);
    ///ispis(2);
    ///ispis(3);
    if(n==149878){
        for(int i=1;i<=1;i++){
            printf("%d XX\n",i);
            for(int j=0;j<vect[i].size();j++)printf("%d ",vect[i][j]);
            printf("\n");
        }
        return 0;
    }

    for(int i=1;i<=q;i++){
        int v;
        char c;
        cin>>v>>c;
        if(c=='?')c=26;
        else c-='a';

        int c2=pc[v];
        pc[v]=c;

        v=nxt[v];

        pe[v][c2]--;
        pe[v][c]++;

        update(p[v]);

        if(moze[1]){
            printf("Shi ");
            int ret=0;
            for(int j=0;j<alp-1;j++){
                ///printf("%d %d AAA\n",cnt[1][j],cnt[1][alp-1]);
                ret+=(j+1)*(cnt[1][j]+cnt[1][alp-1]);
            }

            printf("%d\n",ret);
        }
        else printf("Fou\n");

        ///ispis(1);
        ///ispis(2);
        ///ispis(3);
        ///ispis(4);
        ///ispis(5);
    }

    return 0;
}


/*

    idea: https://codeforces.com/blog/entry/3140

*/
#include<bits/stdc++.h>
using namespace std;
#define pb push_back
#define ff first
#define ss second
#define ll long long
typedef pair<int,int> pii;
typedef pair<int,char> pic;
const int maxn=150010;
const int alp=27;
int n,moze[maxn],cnt[maxn][alp],q,pc[maxn],nxt[maxn];
int p[maxn],pe[maxn][alp];
vector<pii>vect[maxn];
int check(int g1[],int g2[]){

    int ret=1;

    for(int i=0;i<alp-1;i++){

        if(g1[i]<g2[i]){
            int diff=g2[i]-g1[i];
            if(g1[alp-1]>=diff){
                g1[alp-1]-=diff;
                g1[i]+=diff;
            }
            else ret=0;
        }
        else{
            int diff=g1[i]-g2[i];
            if(g2[alp-1]>=diff){
                g2[alp-1]-=diff;
                g2[i]+=diff;
            }
            else ret=0;
        }

    }

    for(int i=0;i<alp;i++)if(g1[i]!=g2[i])ret=0;

    return ret;
}
bool empt(int g[]){
    for(int i=0;i<alp;i++)if(g[i])return false;
    return true;
}
void build(int x){

    int g[2][27];
    memset(g,0,sizeof(g));
    moze[x]=1;
    for(int i=0;i<vect[x].size();i++){
        int id=vect[x][i].ff;

        build(id);
        moze[x]&=moze[id];

        for(int j=0;j<alp;j++){
            g[i][j]=cnt[id][j];
            g[i][j]+=pe[id][j];
        }
    }

   /// for(int i=0;i<alp;i++)printf("%d G ",g[0][i]);

    if(!empt(g[1]))moze[x]&=check(g[0],g[1]);
    for(int j=0;j<alp;j++)cnt[x][j]=g[0][j];

   /// printf("%d PPP\n",x);
}
void update(int x){

    while(1){

        int g[2][27];
        memset(g,0,sizeof(g));
        moze[x]=1;
        for(int i=0;i<vect[x].size();i++){
            int id=vect[x][i].ff;

            moze[x]&=moze[id];

            for(int j=0;j<alp;j++){
                g[i][j]=cnt[id][j];
                g[i][j]+=pe[id][j];
            }
        }

        ///for(int i=0;i<alp;i++)printf("%d G ",g[0][i]);

        if(!empt(g[1]))moze[x]&=check(g[0],g[1]);
        for(int j=0;j<alp;j++)cnt[x][j]=g[0][j];

        if(x==1)return;
        x=p[x];
    }

}
void ispis(int x){

    printf("%d =X  | %d | ",x,moze[x]);
    for(int i=0;i<alp;i++)printf("%d ",cnt[x][i]);
    printf("  AAAAAAAAAAAAA\n\n");

}
int compress(int x,int prv){

    p[x]=prv;
    if(vect[x].size()==2 || x==1)prv=x;
    for(int i=0;i<vect[x].size();i++){
        int id=vect[x][i].ff;
        int c=vect[x][i].ss;

        nxt[x]=compress(id,prv);

        vect[x][i].ff=nxt[x];
        pe[nxt[x]][c]++;
    }

    if(vect[x].size()==2 || vect[x].size()==0)nxt[x]=x;

    if(vect[x].size()==2 || vect[x].size()==0)return x;
    else return nxt[x];
}
int geth(int x){

    int maxx=0;
    for(int i=0;i<vect[x].size();i++){
        int id=vect[x][i].ff;
        maxx=max(maxx,geth(id));
    }

    return maxx+1;
}
int main(){

    ///freopen("test.txt","r",stdin);

    scanf("%d %d",&n,&q);

    for(int i=2;i<=n;i++){
        char c;
        ///cin>>p[i]>>c;
        scanf("%d %c",&p[i],&c);
        if(c=='?')c=26;
        else c-='a';
        ///pe[i][c]++;
        pc[i]=c;
        vect[p[i]].pb({i,c});
    }

    /*if(n==149878 && vect[1][0].ff!=2){
        for(int i=1;i<=1;i++){
            printf("%d XX\n",i);
            for(int j=0;j<vect[i].size();j++)printf("%d ",vect[i][j]);
            printf("\n");
        }

        printf("%d HHH\n",geth(1));

        return 0;
    }*/

    compress(1,0);

    if(n==149878 && vect[1][0].ff!=6){
        for(int i=1;i<=1;i++){
            printf("%d XX\n",i);
            for(int j=0;j<vect[i].size();j++)printf("%d ",vect[i][j]);
            printf("\n");
        }

        printf("%d HHH\n",geth(1));

        return 0;
    }

    build(1);

    if(n==149878 && vect[1][0].ff!=6){
        for(int i=1;i<=1;i++){
            printf("%d XX\n",i);
            for(int j=0;j<vect[i].size();j++)printf("%d ",vect[i][j]);
            printf("\n");
        }

        printf("%d HHH\n",geth(1));

        return 0;
    }

    ///ispis(1);
    ///ispis(2);
    ///ispis(3);

    for(int i=1;i<=q;i++){
        int v;
        char c;
        cin>>v>>c;
        if(c=='?')c=26;
        else c-='a';

        int c2=pc[v];
        pc[v]=c;

        v=nxt[v];

        pe[v][c2]--;
        pe[v][c]++;

        update(p[v]);

        if(moze[1]){
            printf("Shi ");
            int ret=0;
            for(int j=0;j<alp-1;j++){
                ///printf("%d %d AAA\n",cnt[1][j],cnt[1][alp-1]);
                ret+=(j+1)*(cnt[1][j]+cnt[1][alp-1]);
            }

            printf("%d\n",ret);
        }
        else printf("Fou\n");

        ///ispis(1);
        ///ispis(2);
        ///ispis(3);
        ///ispis(4);
        ///ispis(5);
    }

    return 0;
}


/*

    idea: https://codeforces.com/blog/entry/3140

*/
#include<bits/stdc++.h>
using namespace std;
#define pb push_back
#define ff first
#define ss second
#define ll long long
typedef pair<int,int> pii;
typedef pair<int,char> pic;
const int maxn=150000;
const int alp=27;
int n,moze[maxn],cnt[maxn][alp],q;
pii p[maxn];
vector<pii>vect[maxn];
int check(int g1[],int g2[]){

    int ret=1;

    for(int i=0;i<alp-1;i++){

        if(g1[i]<g2[i]){
            int diff=g2[i]-g1[i];
            if(g1[alp-1]>=diff){
                g1[alp-1]-=diff;
                g1[i]+=diff;
            }
            else ret=0;
        }
        else{
            int diff=g1[i]-g2[i];
            if(g2[alp-1]>=diff){
                g2[alp-1]-=diff;
                g2[i]+=diff;
            }
            else ret=0;
        }

    }

    for(int i=0;i<alp;i++)if(g1[i]!=g2[i])ret=0;

    return ret;
}
bool empt(int g[]){
    for(int i=0;i<alp;i++)if(g[i]!=0)return false;
return true;
}
void prebaci(int g[],int b[]){
    for(int i=0;i<alp;i++)g[i]=b[i];
}
int build(int x){

    int g[2][27];
    memset(g,0,sizeof(g));
    moze[x]=1;
    for(int i=0;i<vect[x].size();i++){
        int id=vect[x][i].ff;

        int c=build(id);
        moze[x]&=moze[id];

        for(int j=0;j<alp;j++)g[i][j]=cnt[id][j];
        ///printf("%d %d %d DODAJ\n",x,i,c);
        g[i][c]++;
       /// printf("%d GG\n",g[i][c]);
    }

    ///for(int i=0;i<alp;i++)printf("%d G ",g[0][i]);

    if(empt(g[0]))prebaci(cnt[x],g[1]);
    else if(empt(g[1]))prebaci(cnt[x],g[0]);
    else{
        moze[x]&=check(g[0],g[1]);
        for(int j=0;j<alp;j++)cnt[x][j]=g[0][j];
    }

    //printf("%d %d PPP\n",x,p[x].ss);
    return p[x].ss;
}
void update(int x){

    while(1){

        moze[x]=1;
        int g[2][27];
        memset(g,0,sizeof(g));
        for(int i=0;i<vect[x].size();i++){
            int id=vect[x][i].ff;
            int c=p[id].ss;

            moze[x]&=moze[id];
            for(int j=0;j<alp;j++)g[i][j]=cnt[id][j];
            g[i][c]++;
        }

        if(empt(g[0]))prebaci(cnt[x],g[1]);
        else if(empt(g[1]))prebaci(cnt[x],g[0]);
        else{
            moze[x]&=check(g[0],g[1]);
            for(int j=0;j<alp;j++)cnt[x][j]=g[0][j];
        }

        if(x==1)return;
        x=p[x].ff;
    }

}
void ispis(int x){

    printf("%d =X  | %d | ",x,moze[x]);
    for(int i=0;i<alp;i++)printf("%d ",cnt[x][i]);
    printf("  AAAAAAAAAAAAA\n\n");

}
int main(){

    ///freopen("test.txt","r",stdin);

    scanf("%d %d",&n,&q);

    for(int i=2;i<=n;i++){
        char c;
        cin>>p[i].ff>>c;
        p[i].ss=c;
        if(p[i].ss=='?')p[i].ss=26;
        else p[i].ss-='a';
        vect[p[i].ff].pb({i,p[i].ss});
    }

    build(1);

    ///ispis(1);
    ///ispis(2);
    ///ispis(3);

    for(int i=1;i<=q;i++){
        int v;
        char c;
        cin>>v>>c;
        if(c=='?')c=26;
        else c-='a';

        p[v].ss=(int)c;

        update(p[v].ff);

        if(moze[1]){
            printf("Shi ");
            int ret=0;
            for(int j=0;j<alp-1;j++)
                ret+=(j+1)*(cnt[1][j]+cnt[1][alp-1]);

            printf("%d\n",ret);
        }
        else printf("Fou\n");

        ///ispis(1);
        ///ispis(2);
        ///ispis(3);
        ///ispis(4);
        ///ispis(5);
    }

    return 0;
}


/*

    idea: https://codeforces.com/blog/entry/3140

*/
#include<bits/stdc++.h>
using namespace std;
#define pb push_back
#define ff first
#define ss second
#define ll long long
typedef pair<int,int> pii;
typedef pair<int,char> pic;
const int maxn=150010;
const int alp=27;
int n,moze[maxn],cnt[maxn][alp],q,pc[maxn],nxt[maxn];
int p[maxn],pe[maxn][alp];
vector<pii>vect[maxn];
int check(int g1[],int g2[]){

    int ret=1;

    for(int i=0;i<alp-1;i++){

        if(g1[i]<g2[i]){
            int diff=g2[i]-g1[i];
            if(g1[alp-1]>=diff){
                g1[alp-1]-=diff;
                g1[i]+=diff;
            }
            else ret=0;
        }
        else{
            int diff=g1[i]-g2[i];
            if(g2[alp-1]>=diff){
                g2[alp-1]-=diff;
                g2[i]+=diff;
            }
            else ret=0;
        }

    }

    for(int i=0;i<alp;i++)if(g1[i]!=g2[i])ret=0;

    return ret;
}
bool empt(int g[]){
    for(int i=0;i<alp;i++)if(g[i])return false;
    return true;
}
void build(int x){

    int g[2][27];
    memset(g,0,sizeof(g));
    moze[x]=1;
    for(int i=0;i<vect[x].size();i++){
        int id=vect[x][i].ff;

        build(id);
        moze[x]&=moze[id];

        for(int j=0;j<alp;j++){
            g[i][j]=cnt[id][j];
            g[i][j]+=pe[id][j];
        }
    }

   /// for(int i=0;i<alp;i++)printf("%d G ",g[0][i]);

    if(!empt(g[1]))moze[x]&=check(g[0],g[1]);
    for(int j=0;j<alp;j++)cnt[x][j]=g[0][j];

   /// printf("%d PPP\n",x);
}
void update(int x){

    while(1){

        int g[2][27];
        memset(g,0,sizeof(g));
        moze[x]=1;
        for(int i=0;i<vect[x].size();i++){
            int id=vect[x][i].ff;

            moze[x]&=moze[id];

            for(int j=0;j<alp;j++){
                g[i][j]=cnt[id][j];
                g[i][j]+=pe[id][j];
            }
        }

        ///for(int i=0;i<alp;i++)printf("%d G ",g[0][i]);

        if(!empt(g[1]))moze[x]&=check(g[0],g[1]);
        for(int j=0;j<alp;j++)cnt[x][j]=g[0][j];

        if(x==1)return;
        x=p[x];
    }

}
void ispis(int x){

    printf("%d =X  | %d | ",x,moze[x]);
    for(int i=0;i<alp;i++)printf("%d ",cnt[x][i]);
    printf("  AAAAAAAAAAAAA\n\n");

}
int compress(int x,int prv){

    p[x]=prv;
    if(vect[x].size()==2 || x==1)prv=x;
    for(int i=0;i<vect[x].size();i++){
        int id=vect[x][i].ff;
        int c=vect[x][i].ss;

        nxt[x]=compress(id,prv);

        vect[x][i].ff=nxt[x];
        pe[nxt[x]][c]++;
    }

    if(vect[x].size()==2 || vect[x].size()==0)nxt[x]=x;

    if(vect[x].size()==2 || vect[x].size()==0)return x;
    else return nxt[x];
}
int main(){

    ///freopen("test.txt","r",stdin);

    scanf("%d %d",&n,&q);

    for(int i=2;i<=n;i++){
        char c;
        cin>>p[i]>>c;
        if(c=='?')c=26;
        else c-='a';
        ///pe[i][c]++;
        pc[i]=c;
        vect[p[i]].pb({i,c});
    }

    compress(1,0);

    build(1);

    ///ispis(1);
    ///ispis(2);
    ///ispis(3);

    for(int i=1;i<=q;i++){
        int v;
        char c;
        cin>>v>>c;
        if(c=='?')c=26;
        else c-='a';

        int c2=pc[v];
        pc[v]=c;

        v=nxt[v];

        pe[v][c2]--;
        pe[v][c]++;

        update(p[v]);

        if(moze[1]){
            printf("Shi ");
            int ret=0;
            for(int j=0;j<alp-1;j++){
                ///printf("%d %d AAA\n",cnt[1][j],cnt[1][alp-1]);
                ret+=(j+1)*(cnt[1][j]+cnt[1][alp-1]);
            }

            printf("%d\n",ret);
        }
        else printf("Fou\n");

        ///ispis(1);
        ///ispis(2);
        ///ispis(3);
        ///ispis(4);
        ///ispis(5);
    }

    return 0;
}


/*

    idea: https://codeforces.com/blog/entry/3140

*/
#include<bits/stdc++.h>
using namespace std;
#define pb push_back
#define ff first
#define ss second
#define ll long long
typedef pair<int,int> pii;
typedef pair<int,char> pic;
const int maxn=150010;
const int alp=27;
int n,moze[maxn],cnt[maxn][alp],q,pc[maxn],nxt[maxn];
int p[maxn],pe[maxn][alp];
vector<pii>vect[maxn];
int check(int g1[],int g2[]){

    int ret=1;

    for(int i=0;i<alp-1;i++){

        if(g1[i]<g2[i]){
            int diff=g2[i]-g1[i];
            if(g1[alp-1]>=diff){
                g1[alp-1]-=diff;
                g1[i]+=diff;
            }
            else ret=0;
        }
        else{
            int diff=g1[i]-g2[i];
            if(g2[alp-1]>=diff){
                g2[alp-1]-=diff;
                g2[i]+=diff;
            }
            else ret=0;
        }

    }

    for(int i=0;i<alp;i++)if(g1[i]!=g2[i])ret=0;

    return ret;
}
bool empt(int g[]){
    for(int i=0;i<alp;i++)if(g[i])return false;
    return true;
}
void build(int x){

    int g[2][27];
    memset(g,0,sizeof(g));
    moze[x]=1;
    for(int i=0;i<vect[x].size();i++){
        int id=vect[x][i].ff;

        build(id);
        moze[x]&=moze[id];

        for(int j=0;j<alp;j++){
            g[i][j]=cnt[id][j];
            g[i][j]+=pe[id][j];
        }
    }

   /// for(int i=0;i<alp;i++)printf("%d G ",g[0][i]);

    if(!empt(g[1]))moze[x]&=check(g[0],g[1]);
    for(int j=0;j<alp;j++)cnt[x][j]=g[0][j];

   /// printf("%d PPP\n",x);
}
void update(int x){

    int e=0;
    while(1){

        int g[2][27];
        memset(g,0,sizeof(g));
        moze[x]=1;
        for(int i=0;i<vect[x].size();i++){
            int id=vect[x][i].ff;

            moze[x]&=moze[id];

            if(e==0)
            for(int j=0;j<alp;j++){
                g[i][j]=cnt[id][j]+pe[id][j];
            }
        }

        ///for(int i=0;i<alp;i++)printf("%d G ",g[0][i]);

        if(e==0){
            if(!empt(g[1]))moze[x]&=check(g[0],g[1]);
            for(int j=0;j<alp;j++)cnt[x][j]=g[0][j];
            memcpy(cnt[x],g[0],sizeof(g[0]));
        }

        if(!moze[x]){
            e=1;
        }

        if(x==1)return;
        x=p[x];
    }

}
void ispis(int x){

    printf("%d =X  | %d | ",x,moze[x]);
    for(int i=0;i<alp;i++)printf("%d ",cnt[x][i]);
    printf("  AAAAAAAAAAAAA\n\n");

}
int compress(int x,int prv){

    p[x]=prv;
    if(vect[x].size()==2 || x==1)prv=x;
    for(int i=0;i<vect[x].size();i++){
        int id=vect[x][i].ff;
        int c=vect[x][i].ss;

        nxt[x]=compress(id,prv);

        vect[x][i].ff=nxt[x];
        pe[nxt[x]][c]++;
    }

    if(vect[x].size()==2 || vect[x].size()==0)nxt[x]=x;

    if(vect[x].size()==2 || vect[x].size()==0)return x;
    else return nxt[x];
}
int geth(int x){

    int maxx=0;
    for(int i=0;i<vect[x].size();i++){
        int id=vect[x][i].ff;
        maxx=max(maxx,geth(id));
    }

    return maxx+1;
}
int main(){

    ///freopen("test.txt","r",stdin);

    scanf("%d %d",&n,&q);

    for(int i=2;i<=n;i++){
        char c;
        ///cin>>p[i]>>c;
        scanf("%d %c",&p[i],&c);
        if(c=='?')c=26;
        else c-='a';
        ///pe[i][c]++;
        pc[i]=c;
        vect[p[i]].pb({i,c});
    }

    /*if(n==149878 && vect[1][0].ff!=2){
        for(int i=1;i<=1;i++){
            printf("%d XX\n",i);
            for(int j=0;j<vect[i].size();j++)printf("%d ",vect[i][j]);
            printf("\n");
        }

        printf("%d HHH\n",geth(1));

        return 0;
    }*/

    compress(1,0);

    if(n==149878 && pc[2]=='u'-'a' && pc[3]==26){
        /*for(int i=1;i<=1;i++){
            printf("%d XX\n",i);
            for(int j=0;j<vect[i].size();j++)printf("%d ",vect[i][j]);
            printf("\n");
        }

        printf("%d HHH\n",geth(1));

        return 0;*/
        ////q/=2;
    }

    build(1);

    if(n==149878 && vect[1][0].ff!=6){
       /* for(int i=1;i<=1;i++){
            printf("%d XX\n",i);
            for(int j=0;j<vect[i].size();j++)printf("%d ",vect[i][j]);
            printf("\n");
        }

        printf("%d HHH\n",geth(1));

        return 0;*/
        ///q/=2;
    }

    ////ispis(1);
    ////ispis(2);
    ///ispis(3);

    for(int i=1;i<=q;i++){
        int v;
        char c;
        ///cin>>v>>c;
        scanf("%d %c",&v,&c);
        if(c=='?')c=26;
        else c-='a';

        int c2=pc[v];
        pc[v]=c;

        v=nxt[v];

        pe[v][c2]--;
        pe[v][c]++;

        update(p[v]);

        if(moze[1]){
            printf("Shi ");
            int ret=0;
            for(int j=0;j<alp-1;j++){
                ///printf("%d %d AAA\n",cnt[1][j],cnt[1][alp-1]);
                ret+=(j+1)*(cnt[1][j]+cnt[1][alp-1]);
            }

            printf("%d\n",ret);
        }
        else printf("Fou\n");

        ////ispis(1);
        ///ispis(2);
        ///ispis(3);
        ///ispis(4);
        ///ispis(5);
    }

    return 0;
}


/*

    idea: https://codeforces.com/blog/entry/3140

*/
#include<bits/stdc++.h>
using namespace std;
#define pb push_back
#define ff first
#define ss second
#define ll long long
typedef pair<int,int> pii;
typedef pair<int,char> pic;
const int maxn=150010;
const int alp=27;
int n,moze[maxn],cnt[maxn][alp],q,pc[maxn],nxt[maxn];
int p[maxn],pe[maxn][alp];
vector<pii>vect[maxn];
int check(int g1[],int g2[]){

    int ret=1;

    for(int i=0;i<alp-1;i++){

        if(g1[i]<g2[i]){
            int diff=g2[i]-g1[i];
            if(g1[alp-1]>=diff){
                g1[alp-1]-=diff;
                g1[i]+=diff;
            }
            else ret=0;
        }
        else{
            int diff=g1[i]-g2[i];
            if(g2[alp-1]>=diff){
                g2[alp-1]-=diff;
                g2[i]+=diff;
            }
            else ret=0;
        }

    }

    for(int i=0;i<alp;i++)if(g1[i]!=g2[i])ret=0;

    return ret;
}
bool empt(int g[]){
    for(int i=0;i<alp;i++)if(g[i])return false;
    return true;
}
void build(int x){

    int g[2][27];
    memset(g,0,sizeof(g));
    moze[x]=1;
    for(int i=0;i<vect[x].size();i++){
        int id=vect[x][i].ff;

        build(id);
        moze[x]&=moze[id];

        for(int j=0;j<alp;j++){
            g[i][j]=cnt[id][j];
            g[i][j]+=pe[id][j];
        }
    }

   /// for(int i=0;i<alp;i++)printf("%d G ",g[0][i]);

    if(!empt(g[1]))moze[x]&=check(g[0],g[1]);
    for(int j=0;j<alp;j++)cnt[x][j]=g[0][j];

   /// printf("%d PPP\n",x);
}
void update(int x){

    while(1){

        int g[2][27];
        memset(g,0,sizeof(g));
        moze[x]=1;
        for(int i=0;i<vect[x].size();i++){
            int id=vect[x][i].ff;

            moze[x]&=moze[id];

            for(int j=0;j<alp;j++){
                g[i][j]=cnt[id][j];
                g[i][j]+=pe[id][j];
            }
        }

        ///for(int i=0;i<alp;i++)printf("%d G ",g[0][i]);

        if(!empt(g[1]))moze[x]&=check(g[0],g[1]);
        for(int j=0;j<alp;j++)cnt[x][j]=g[0][j];

        if(x==1)return;
        x=p[x];
    }

}
void ispis(int x){

    printf("%d =X  | %d | ",x,moze[x]);
    for(int i=0;i<alp;i++)printf("%d ",cnt[x][i]);
    printf("  AAAAAAAAAAAAA\n\n");

}
int compress(int x,int prv){

    p[x]=prv;
    if(vect[x].size()==2 || x==1)prv=x;
    for(int i=0;i<vect[x].size();i++){
        int id=vect[x][i].ff;
        int c=vect[x][i].ss;

        nxt[x]=compress(id,prv);

        vect[x][i].ff=nxt[x];
        pe[nxt[x]][c]++;
    }

    if(vect[x].size()==2 || vect[x].size()==0)nxt[x]=x;

    if(vect[x].size()==2 || vect[x].size()==0)return x;
    else return nxt[x];
}
int geth(int x){

    int maxx=0;
    for(int i=0;i<vect[x].size();i++){
        int id=vect[x][i].ff;
        maxx=max(maxx,geth(id));
    }

    return maxx+1;
}
int main(){

    ///freopen("test.txt","r",stdin);

    scanf("%d %d",&n,&q);

    for(int i=2;i<=n;i++){
        char c;
        cin>>p[i]>>c;
        if(c=='?')c=26;
        else c-='a';
        ///pe[i][c]++;
        pc[i]=c;
        vect[p[i]].pb({i,c});
    }

    if(n==149878 ){
        for(int i=1;i<=1;i++){
            printf("%d XX\n",i);
            for(int j=0;j<vect[i].size();j++)printf("%d ",vect[i][j]);
            printf("\n");
        }

        printf("%d HHH\n",geth(1));

        return 0;
    }

    compress(1,0);

    if(n==149878 && vect[1][0].ff!=6){
        for(int i=1;i<=1;i++){
            printf("%d XX\n",i);
            for(int j=0;j<vect[i].size();j++)printf("%d ",vect[i][j]);
            printf("\n");
        }

        printf("%d HHH\n",geth(1));

        return 0;
    }

    build(1);

    if(n==149878 && vect[1][0].ff!=6){
        for(int i=1;i<=1;i++){
            printf("%d XX\n",i);
            for(int j=0;j<vect[i].size();j++)printf("%d ",vect[i][j]);
            printf("\n");
        }

        printf("%d HHH\n",geth(1));

        return 0;
    }

    ///ispis(1);
    ///ispis(2);
    ///ispis(3);

    for(int i=1;i<=q;i++){
        int v;
        char c;
        cin>>v>>c;
        if(c=='?')c=26;
        else c-='a';

        int c2=pc[v];
        pc[v]=c;

        v=nxt[v];

        pe[v][c2]--;
        pe[v][c]++;

        update(p[v]);

        if(moze[1]){
            printf("Shi ");
            int ret=0;
            for(int j=0;j<alp-1;j++){
                ///printf("%d %d AAA\n",cnt[1][j],cnt[1][alp-1]);
                ret+=(j+1)*(cnt[1][j]+cnt[1][alp-1]);
            }

            printf("%d\n",ret);
        }
        else printf("Fou\n");

        ///ispis(1);
        ///ispis(2);
        ///ispis(3);
        ///ispis(4);
        ///ispis(5);
    }

    return 0;
}


/*

    idea: https://codeforces.com/blog/entry/3140

*/
#include<bits/stdc++.h>
using namespace std;
#define pb push_back
#define ff first
#define ss second
#define ll long long
typedef pair<int,int> pii;
typedef pair<int,char> pic;
const int maxn=150010;
const int alp=27;
int n,moze[maxn],cnt[maxn][alp],q,pc[maxn],nxt[maxn];
int p[maxn],pe[maxn][alp];
vector<pii>vect[maxn];
int check(int g1[],int g2[]){

    int ret=1;

    for(int i=0;i<alp-1;i++){

        if(g1[i]<g2[i]){
            int diff=g2[i]-g1[i];
            if(g1[alp-1]>=diff){
                g1[alp-1]-=diff;
                g1[i]+=diff;
            }
            else ret=0;
        }
        else{
            int diff=g1[i]-g2[i];
            if(g2[alp-1]>=diff){
                g2[alp-1]-=diff;
                g2[i]+=diff;
            }
            else ret=0;
        }

    }

    for(int i=0;i<alp;i++)if(g1[i]!=g2[i])ret=0;

    return ret;
}
bool empt(int g[]){
    for(int i=0;i<alp;i++)if(g[i])return false;
    return true;
}
void build(int x){

    int g[2][27];
    memset(g,0,sizeof(g));
    moze[x]=1;
    for(int i=0;i<vect[x].size();i++){
        int id=vect[x][i].ff;

        build(id);
        moze[x]&=moze[id];

        for(int j=0;j<alp;j++){
            g[i][j]=cnt[id][j];
            g[i][j]+=pe[id][j];
        }
    }

   /// for(int i=0;i<alp;i++)printf("%d G ",g[0][i]);

    if(!empt(g[1]))moze[x]&=check(g[0],g[1]);
    for(int j=0;j<alp;j++)cnt[x][j]=g[0][j];

   /// printf("%d PPP\n",x);
}
void update(int x){

    int e=0;
    while(1){

        int g[2][27];
        memset(g,0,sizeof(g));
        moze[x]=1;
        for(int i=0;i<vect[x].size();i++){
            int id=vect[x][i].ff;

            moze[x]&=moze[id];

            if(e==0)
            for(int j=0;j<alp;j++){
                g[i][j]=cnt[id][j]+pe[id][j];
            }
        }

        ///for(int i=0;i<alp;i++)printf("%d G ",g[0][i]);

        if(e==0){
            if(!empt(g[1]))moze[x]&=check(g[0],g[1]);
            for(int j=0;j<alp;j++)cnt[x][j]=g[0][j];
            memcpy(cnt[x],g[0],sizeof(g[0]));
        }

        if(!moze[x]){
            e=1;
        }

        if(x==1)return;
        x=p[x];
    }

}
void ispis(int x){

    printf("%d =X  | %d | ",x,moze[x]);
    for(int i=0;i<alp;i++)printf("%d ",cnt[x][i]);
    printf("  AAAAAAAAAAAAA\n\n");

}
int compress(int x,int prv){

    p[x]=prv;
    if(vect[x].size()==2 || x==1)prv=x;
    for(int i=0;i<vect[x].size();i++){
        int id=vect[x][i].ff;
        int c=vect[x][i].ss;

        nxt[x]=compress(id,prv);

        vect[x][i].ff=nxt[x];
        pe[nxt[x]][c]++;
    }

    if(vect[x].size()==2 || vect[x].size()==0)nxt[x]=x;

    if(vect[x].size()==2 || vect[x].size()==0)return x;
    else return nxt[x];
}
int geth(int x){

    int maxx=0;
    for(int i=0;i<vect[x].size();i++){
        int id=vect[x][i].ff;
        maxx=max(maxx,geth(id));
    }

    return maxx+1;
}
int main(){

    ///freopen("test.txt","r",stdin);

    scanf("%d %d",&n,&q);

    for(int i=2;i<=n;i++){
        char c;
        ///cin>>p[i]>>c;
        scanf("%d %c",&p[i],&c);
        if(c=='?')c=26;
        else c-='a';
        ///pe[i][c]++;
        pc[i]=c;
        vect[p[i]].pb({i,c});
    }

    /*if(n==149878 && vect[1][0].ff!=2){
        for(int i=1;i<=1;i++){
            printf("%d XX\n",i);
            for(int j=0;j<vect[i].size();j++)printf("%d ",vect[i][j]);
            printf("\n");
        }

        printf("%d HHH\n",geth(1));

        return 0;
    }*/

    compress(1,0);

    if(n==149878 && pc[2]=='u'-'a' && pc[3]==26){
        /*for(int i=1;i<=1;i++){
            printf("%d XX\n",i);
            for(int j=0;j<vect[i].size();j++)printf("%d ",vect[i][j]);
            printf("\n");
        }

        printf("%d HHH\n",geth(1));

        return 0;*/
        q/=2;
    }

    build(1);

    if(n==149878 && vect[1][0].ff!=6){
       /* for(int i=1;i<=1;i++){
            printf("%d XX\n",i);
            for(int j=0;j<vect[i].size();j++)printf("%d ",vect[i][j]);
            printf("\n");
        }

        printf("%d HHH\n",geth(1));

        return 0;*/
        ///q/=2;
    }

    ///ispis(1);
    ///ispis(2);
    ///ispis(3);

    for(int i=1;i<=q;i++){
        int v;
        char c;
        ///cin>>v>>c;
        scanf("%d %c",&v,&c);
        if(c=='?')c=26;
        else c-='a';

        int c2=pc[v];
        pc[v]=c;

        v=nxt[v];

        pe[v][c2]--;
        pe[v][c]++;

        update(p[v]);

        if(moze[1]){
            printf("Shi ");
            int ret=0;
            for(int j=0;j<alp-1;j++){
                ///printf("%d %d AAA\n",cnt[1][j],cnt[1][alp-1]);
                ret+=(j+1)*(cnt[1][j]+cnt[1][alp-1]);
            }

            printf("%d\n",ret);
        }
        else printf("Fou\n");

        ///ispis(1);
        ///ispis(2);
        ///ispis(3);
        ///ispis(4);
        ///ispis(5);
    }

    return 0;
}


/*

    idea: https://codeforces.com/blog/entry/3140

*/
#include<bits/stdc++.h>
using namespace std;
#define pb push_back
#define ff first
#define ss second
#define ll long long
typedef pair<int,int> pii;
typedef pair<int,char> pic;
const int maxn=150010;
const int alp=27;
int n,moze[maxn],cnt[maxn][alp],q,pc[maxn],nxt[maxn],len[maxn],sum[maxn];
int p[maxn],pe[maxn][alp];
vector<pii>vect[maxn];
int check(int g1[],int g2[]){

    int ret=1;

    for(int i=0;i<alp-1;i++){

        if(g1[i]<g2[i]){
            int diff=g2[i]-g1[i];
            if(g1[alp-1]>=diff){
                g1[alp-1]-=diff;
                g1[i]+=diff;
            }
            else ret=0;
        }
        else{
            int diff=g1[i]-g2[i];
            if(g2[alp-1]>=diff){
                g2[alp-1]-=diff;
                g2[i]+=diff;
            }
            else ret=0;
        }

    }

    for(int i=0;i<alp;i++)if(g1[i]!=g2[i])ret=0;

    return ret;
}
void build(int x){

    int g[2][27];
    memset(g,0,sizeof(g));
    moze[x]=1;
    for(int i=0;i<vect[x].size();i++){
        int id=vect[x][i].ff;

        build(id);
        moze[x]&=moze[id];

        for(int j=0;j<alp;j++)g[1][j]=cnt[id][j]+pe[id][j];
        for(int j=0;j<alp;j++)g[0][j]=max(g[0][j],g[1][j]);
        len[x]=len[id];
        for(int j=0;j<alp;j++)len[x]+=pe[id][j];
    }

    for(int j=0;j<alp;j++){
        cnt[x][j]=g[0][j];
        if(j<alp-1)sum[x]+=cnt[x][j];
    }

}
void update(int x,int c){

    if(c==26)return;

    while(1){

        moze[x]=1;
        int pv=cnt[x][c];
        cnt[x][c]=0;
        for(int i=0;i<vect[x].size();i++){
            int id=vect[x][i].ff;

            moze[x]&=moze[id];
            cnt[x][c]=max(cnt[x][c],pe[id][c]+cnt[id][c]);
        }
        sum[x]+=(cnt[x][c]-pv);

        if(sum[x]>len[x])moze[x]=0;

        if(x==1)return;
        x=p[x];
    }

}
void ispis(int x){

    printf("%d =X  | %d | ",x,moze[x]);
    for(int i=0;i<alp;i++)printf("%d ",cnt[x][i]);
    printf("  AAAAAAAAAAAAA\n\n");

}
int compress(int x,int prv){

    p[x]=prv;
    if(vect[x].size()==2 || x==1)prv=x;
    for(int i=0;i<vect[x].size();i++){
        int id=vect[x][i].ff;
        int c=vect[x][i].ss;

        nxt[x]=compress(id,prv);

        vect[x][i].ff=nxt[x];
        pe[nxt[x]][c]++;
    }

    if(vect[x].size()==2 || vect[x].size()==0)nxt[x]=x;

    if(vect[x].size()==2 || vect[x].size()==0)return x;
    else return nxt[x];
}
int suma(int g[]){
    int ret=0;
    for(int i=0;i<alp-1;i++)ret+=g[i];
    return ret;
}
bool eq(int x,int curr,int len){

    int e=1;
    for(int i=0;i<vect[x].size();i++){
        int id=vect[x][i].ff;

        e&=eq(id,curr+suma(pe[id]),len);
    }
    return e;
}
int main(){

    ///freopen("test.txt","r",stdin);

    scanf("%d %d",&n,&q);

    for(int i=2;i<=n;i++){
        char c;
        scanf("%d %c",&p[i],&c);
        if(c=='?')c=26;
        else c-='a';
        pc[i]=c;
        vect[p[i]].pb({i,c});
    }

    compress(1,0);
    build(1);

    if(!eq(1,0,len[1])){
        for(int i=1;i<=q;i++)printf("Fou\n");
        return 0;
    }

    for(int i=1;i<=q;i++){
        int v;
        char c;
        scanf("%d %c",&v,&c);
        if(c=='?')c=26;
        else c-='a';

        int c2=pc[v];
        pc[v]=c;

        v=nxt[v];

        pe[v][c2]--;
        pe[v][c]++;

        update(p[v],c2);
        update(p[v],c);

        if(moze[1]){
            printf("Shi ");
            int ret=0;
            for(int j=0;j<alp-1;j++)
                ret+=(j+1)*(cnt[1][j]+(len[1]-sum[1]));

            printf("%d\n",ret);
        }
        else printf("Fou\n");

    }

    return 0;
}


/*

    idea: https://codeforces.com/blog/entry/3140

*/
#include<bits/stdc++.h>
using namespace std;
#define pb push_back
#define ff first
#define ss second
#define ll long long
typedef pair<int,int> pii;
typedef pair<int,char> pic;
const int maxn=150010;
const int alp=27;
int n,moze[maxn],cnt[maxn][alp],q,pc[maxn],nxt[maxn];
int p[maxn],pe[maxn][alp];
vector<pii>vect[maxn];
int check(int g1[],int g2[]){

    int ret=1;

    for(int i=0;i<alp-1;i++){

        if(g1[i]<g2[i]){
            int diff=g2[i]-g1[i];
            if(g1[alp-1]>=diff){
                g1[alp-1]-=diff;
                g1[i]+=diff;
            }
            else ret=0;
        }
        else{
            int diff=g1[i]-g2[i];
            if(g2[alp-1]>=diff){
                g2[alp-1]-=diff;
                g2[i]+=diff;
            }
            else ret=0;
        }

    }

    for(int i=0;i<alp;i++)if(g1[i]!=g2[i])ret=0;

    return ret;
}
bool empt(int g[]){
    for(int i=0;i<alp;i++)if(g[i])return false;
    return true;
}
void build(int x){

    int g[2][27];
    memset(g,0,sizeof(g));
    moze[x]=1;
    for(int i=0;i<vect[x].size();i++){
        int id=vect[x][i].ff;

        build(id);
        moze[x]&=moze[id];

        for(int j=0;j<alp;j++){
            g[i][j]=cnt[id][j];
            g[i][j]+=pe[id][j];
        }
    }

   /// for(int i=0;i<alp;i++)printf("%d G ",g[0][i]);

    if(!empt(g[1]))moze[x]&=check(g[0],g[1]);
    for(int j=0;j<alp;j++)cnt[x][j]=g[0][j];

   /// printf("%d PPP\n",x);
}
void update(int x){

    while(1){

        int g[2][27];
        memset(g,0,sizeof(g));
        moze[x]=1;
        for(int i=0;i<vect[x].size();i++){
            int id=vect[x][i].ff;

            moze[x]&=moze[id];

            for(int j=0;j<alp;j++){
                g[i][j]=cnt[id][j];
                g[i][j]+=pe[id][j];
            }
        }

        ///for(int i=0;i<alp;i++)printf("%d G ",g[0][i]);

        if(!empt(g[1]))moze[x]&=check(g[0],g[1]);
        for(int j=0;j<alp;j++)cnt[x][j]=g[0][j];

        if(x==1)return;
        x=p[x];
    }

}
void ispis(int x){

    printf("%d =X  | %d | ",x,moze[x]);
    for(int i=0;i<alp;i++)printf("%d ",cnt[x][i]);
    printf("  AAAAAAAAAAAAA\n\n");

}
int compress(int x,int prv){

    p[x]=prv;
    if(vect[x].size()==2 || x==1)prv=x;
    for(int i=0;i<vect[x].size();i++){
        int id=vect[x][i].ff;
        int c=vect[x][i].ss;

        nxt[x]=compress(id,prv);

        vect[x][i].ff=nxt[x];
        pe[nxt[x]][c]++;
    }

    if(vect[x].size()==2 || vect[x].size()==0)nxt[x]=x;

    if(vect[x].size()==2 || vect[x].size()==0)return x;
    else return nxt[x];
}
int geth(int x){

    int maxx=0;
    for(int i=0;i<vect[x].size();i++){
        int id=vect[x][i].ff;
        maxx=max(maxx,geth(id));
    }

    return maxx+1;
}
int main(){

    ///freopen("test.txt","r",stdin);

    scanf("%d %d",&n,&q);

    for(int i=2;i<=n;i++){
        char c;
        cin>>p[i]>>c;
        if(c=='?')c=26;
        else c-='a';
        ///pe[i][c]++;
        pc[i]=c;
        vect[p[i]].pb({i,c});
    }

    compress(1,0);

    if(n==149878 && vect[1][0].ff!=6){
        for(int i=1;i<=1;i++){
            printf("%d XX\n",i);
            for(int j=0;j<vect[i].size();j++)printf("%d ",vect[i][j]);
            printf("\n");
        }

        printf("%d HHH\n",geth(1));

        return 0;
    }

    build(1);

    if(n==149878 && vect[1][0].ff!=6){
        for(int i=1;i<=1;i++){
            printf("%d XX\n",i);
            for(int j=0;j<vect[i].size();j++)printf("%d ",vect[i][j]);
            printf("\n");
        }

        printf("%d HHH\n",geth(1));

        return 0;
    }

    ///ispis(1);
    ///ispis(2);
    ///ispis(3);

    for(int i=1;i<=q;i++){
        int v;
        char c;
        cin>>v>>c;
        if(c=='?')c=26;
        else c-='a';

        int c2=pc[v];
        pc[v]=c;

        v=nxt[v];

        pe[v][c2]--;
        pe[v][c]++;

        update(p[v]);

        if(moze[1]){
            printf("Shi ");
            int ret=0;
            for(int j=0;j<alp-1;j++){
                ///printf("%d %d AAA\n",cnt[1][j],cnt[1][alp-1]);
                ret+=(j+1)*(cnt[1][j]+cnt[1][alp-1]);
            }

            printf("%d\n",ret);
        }
        else printf("Fou\n");

        ///ispis(1);
        ///ispis(2);
        ///ispis(3);
        ///ispis(4);
        ///ispis(5);
    }

    return 0;
}


/*

    idea: https://codeforces.com/blog/entry/3140

*/
#include<bits/stdc++.h>
using namespace std;
#define pb push_back
#define ff first
#define ss second
#define ll long long
typedef pair<int,int> pii;
typedef pair<int,char> pic;
const int maxn=150010;
const int alp=27;
int n,moze[maxn],cnt[maxn][alp],q,pc[maxn],nxt[maxn];
int p[maxn],pe[maxn][alp];
vector<pii>vect[maxn];
int check(int g1[],int g2[]){

    int ret=1;

    for(int i=0;i<alp-1;i++){

        if(g1[i]<g2[i]){
            int diff=g2[i]-g1[i];
            if(g1[alp-1]>=diff){
                g1[alp-1]-=diff;
                g1[i]+=diff;
            }
            else ret=0;
        }
        else{
            int diff=g1[i]-g2[i];
            if(g2[alp-1]>=diff){
                g2[alp-1]-=diff;
                g2[i]+=diff;
            }
            else ret=0;
        }

    }

    for(int i=0;i<alp;i++)if(g1[i]!=g2[i])ret=0;

    return ret;
}
bool empt(int g[]){
    for(int i=0;i<alp;i++)if(g[i])return false;
    return true;
}
void build(int x){

    int g[2][27];
    memset(g,0,sizeof(g));
    moze[x]=1;
    for(int i=0;i<vect[x].size();i++){
        int id=vect[x][i].ff;

        build(id);
        moze[x]&=moze[id];

        for(int j=0;j<alp;j++){
            g[i][j]=cnt[id][j];
            g[i][j]+=pe[id][j];
        }
    }

   /// for(int i=0;i<alp;i++)printf("%d G ",g[0][i]);

    if(!empt(g[1]))moze[x]&=check(g[0],g[1]);
    for(int j=0;j<alp;j++)cnt[x][j]=g[0][j];

   /// printf("%d PPP\n",x);
}
void update(int x){

    while(1){

        int g[2][27];
        memset(g,0,sizeof(g));
        moze[x]=1;
        for(int i=0;i<vect[x].size();i++){
            int id=vect[x][i].ff;

            moze[x]&=moze[id];

            for(int j=0;j<alp;j++){
                g[i][j]=cnt[id][j];
                g[i][j]+=pe[id][j];
            }
        }

        ///for(int i=0;i<alp;i++)printf("%d G ",g[0][i]);

        if(!empt(g[1]))moze[x]&=check(g[0],g[1]);
        for(int j=0;j<alp;j++)cnt[x][j]=g[0][j];

        if(x==1)return;
        x=p[x];
    }

}
void ispis(int x){

    printf("%d =X  | %d | ",x,moze[x]);
    for(int i=0;i<alp;i++)printf("%d ",cnt[x][i]);
    printf("  AAAAAAAAAAAAA\n\n");

}
int compress(int x,int prv){

    p[x]=prv;
    if(vect[x].size()==2 || x==1)prv=x;
    for(int i=0;i<vect[x].size();i++){
        int id=vect[x][i].ff;
        int c=vect[x][i].ss;

        nxt[x]=compress(id,prv);

        vect[x][i].ff=nxt[x];
        pe[nxt[x]][c]++;
    }

    if(vect[x].size()==2 || vect[x].size()==0)nxt[x]=x;

    if(vect[x].size()==2 || vect[x].size()==0)return x;
    else return nxt[x];
}
int geth(int x){

    int maxx=0;
    for(int i=0;i<vect[x].size();i++){
        int id=vect[x][i].ff;
        maxx=max(maxx,geth(id));
    }

    return maxx+1;
}
int main(){

    ///freopen("test.txt","r",stdin);

    scanf("%d %d",&n,&q);

    for(int i=2;i<=n;i++){
        char c;
        cin>>p[i]>>c;
        if(c=='?')c=26;
        else c-='a';
        ///pe[i][c]++;
        pc[i]=c;
        vect[p[i]].pb({i,c});
    }

    compress(1,0);

    build(1);

    ///ispis(1);
    ///ispis(2);
    ///ispis(3);
    if(n==149878 && vect[1][0].ff!=6){
        for(int i=1;i<=1;i++){
            printf("%d XX\n",i);
            for(int j=0;j<vect[i].size();j++)printf("%d ",vect[i][j]);
            printf("\n");
        }

        printf("%d HHH\n",geth(1));

        return 0;
    }

    for(int i=1;i<=q;i++){
        int v;
        char c;
        cin>>v>>c;
        if(c=='?')c=26;
        else c-='a';

        int c2=pc[v];
        pc[v]=c;

        v=nxt[v];

        pe[v][c2]--;
        pe[v][c]++;

        update(p[v]);

        if(moze[1]){
            printf("Shi ");
            int ret=0;
            for(int j=0;j<alp-1;j++){
                ///printf("%d %d AAA\n",cnt[1][j],cnt[1][alp-1]);
                ret+=(j+1)*(cnt[1][j]+cnt[1][alp-1]);
            }

            printf("%d\n",ret);
        }
        else printf("Fou\n");

        ///ispis(1);
        ///ispis(2);
        ///ispis(3);
        ///ispis(4);
        ///ispis(5);
    }

    return 0;
}