Language: C

#define _[2<<17]
n,i;B _,T _,F _;long M,D _,P _;s(u,i,p,I){P[i]=i?s(u,T[i],p),(I=B[i])-p?s(I,F[I],u),D[u]=D[u]*-~D[I]%M:D[u]:++D[u];}S(u,x,p,i,I){for(i=F[u];I=B[i];I-p?S(I,R[i]*x%M+1,u),x=x*-~D[I]%M:0)i=T[i];P[n-u]=x%M;}main(u,v){for(;~scanf("%d%d",&u,&v);)i++?T[i-1]=F[u],T[i]=F[B[F[u]=i-1]=v],B[F[v]=i++]=u:(n=u,M=v);s(1,F[1]);for(S(1,1);n--;)printf("%d ",P[n]);}

Compiler output:
main.c:1:9: warning: ISO C99 requires whitespace after the macro name
    1 | #define _[2<<17]
      |         ^
main.c:2:1: warning: data definition has no type or storage class
    2 | n,i;B _,T _,F _;long M,D _,P _;s(u,i,p,I){P[i]=i?s(u,T[i],p),(I=B[i])-p?s(I,F[I],u),D[u]=D[u]*-~D[I]%M:D[u]:++D[u];}S(u,x,p,i,I){for(i=F[u];I=B[i];I-p?S(I,R[i]*x%M+1,u),x=x*-~D[I]%M:0)i=T[i];P[n-u]=x%M;}main(u,v){for(;~scanf("%d%d",&u,&v);)i++?T[i-1]=F[u],T[i]=F[B[F[u]=i-1]=v],B[F[v]=i++]=u:(n=u,M=v);s(1,F[1]);for(S(1,1);n--;)printf("%d ",P[n]);}
      | ^
main.c:2:1: error: type defaults to 'int' in declaration of 'n' [-Wimplicit-int]
main.c:2:3: error: type defaults to 'int' in declaration of 'i' [-Wimplicit-int]
    2 | n,i;B _,T _,F _;long M,D _,P _;s(u,i,p,I){P[i]=i?s(u,T[i],p),(I=B[i])-p?s(I,F[I],u),D[u]=D[u]*-~D[I]%M:D[u]:++D[u];}S(u,x,p,i,I){for(i=F[u];I=B[i];I-p?S(I,R[i]*x%M+1,u),x=x*-~D[I]%M:0)i=T[i];P[n-u]=x%M;}main(u,v){for(;~scanf("%d%d",&u,&v);)i++?T[i-1]=F[u],T[i]=F[B[F[u]=i-1]=v],B[F[v]=i++]=u:(n=u,M=v);s(1,F[1]);for(S(1,1);n--;)printf("%d ",P[n]);}
      |   ^
main.c:2:5: warning: data definition has no type or storage class
    2 | n,i;B _,T _,F _;long M,D _,P _;s(u,i,p,I){P[i]=i?s(u,T[i],p),(I=B[i])-p?s(I,F[I],u),D[u]=D[u]*-~D[I]%M:D[u]:++D[u];}S(u,x,p,i,I){for(i=F[u];I=B[i];I-p?S(I,R[i]*x%M+1,u),x=x*-~D[I]%M:0)i=T[i];P[n-u]=x%M;}main(u,v){for(;~scanf("%d%d",&u,&v);)i++?T[i-1]=F[u],T[i]=F[B[F[u]=i-1]=v],B[F[v]=i++]=u:(n=u,M=v);s(1,F[1]);for(S(1,1);n--;)printf("%d ",P[n]);}
      |     ^
main.c:2:5: error: type defaults to 'int' in declaration of 'B' [-Wimplicit-int]
main.c:2:9: error: type defaults to 'int' in declaration of 'T' [-Wimplicit-int]
    2 | n,i;B _,T _,F _;long M,D _,P _;s(u,i,p,I){P[i]=i?s(u,T[i],p),(I=B[i])-p?s(I,F[I],u),D[u]=D[u]*-~D[I]%M:D[u]:++D[u];}S(u,x,p,i,I){for(i=F[u];I=B[i];I-p?S(I,R[i]*x%M+1,u),x=x*-~D[I]%M:0)i=T[i];P[n-u]=x%M;}main(u,v){for(;~scanf("%d%d",&u,&v);)i++?T[i-1]=F[u],T[i]=F[B[F[u]=i-1]=v],B[F[v]=i++]=u:(n=u,M=v);s(1,F[1]);for(S(1,1);n--;)printf("%d ",P[n]);}
      |         ^
main.c:2:13: error: type defaults to 'int' in declaration of 'F' [-Wimplicit-int]
    2 | n,i;B _,T _,F _;long M,D _,P _;s(u,i,p,I){P[i]=i?s(u,T[i],p),(I=B[i])-p?s(I,F[I],u),D[u]=D[u]*-~D[I]%M:D[u]:++D[u];}S(u,x,p,i,I){for(i=F[u];I=B[i];I-p?S(I,R[i]*x%M+1,u),x=x*-~D[I]%M:0)i=T[i];P[n-u]=x%M;}main(u,v){for(;~scanf("%d%d",&u,&v);)i++?T[i-1]=F[u],T[i]=F[B[F[u]=i-1]=v],B[F[v]=i++]=u:(n=u,M=v);s(1,F[1]);for(S(1,1);n--;)printf("%d ",P[n]);}
      |             ^
main.c:2:32: error: return type defaults to 'int' [-Wimplicit-int]
    2 | n,i;B _,T _,F _;long M,D _,P _;s(u,i,p,I){P[i]=i?s(u,T[i],p),(I=B[i])-p?s(I,F[I],u),D[u]=D[u]*-~D[I]%M:D[u]:++D[u];}S(u,x,p,i,I){for(i=F[u];I=B[i];I-p?S(I,R[i]*x%M+1,u),x=x*-~D[I]%M:0)i=T[i];P[n-u]=x%M;}main(u,v){for(;~scanf("%d%d",&u,&v);)i++?T[i-1]=F[u],T[i]=F[B[F[u]=i-1]=v],B[F[v]=i++]=u:(n=u,M=v);s(1,F[1]);for(S(1,1);n--;)printf("%d ",P[n]);}
      |                                ^
main.c: In function 's':
main.c:2:32: error: type of 'u' defaults to 'int' [-Wimplicit-int]
main.c:2:32: error: type of 'i' defaults to 'int' [-Wimplicit-int]
main.c:2:32: error: type of 'p' defaults to 'int' [-Wimplicit-int]
main.c:2:32: error: type of 'I' defaults to 'int' [-Wimplicit-int]
main.c: At top level:
main.c:2:117: error: return type defaults to 'int' [-Wimplicit-int]
    2 | n,i;B _,T _,F _;long M,D _,P _;s(u,i,p,I){P[i]=i?s(u,T[i],p),(I=B[i])-p?s(I,F[I],u),D[u]=D[u]*-~D[I]%M:D[u]:++D[u];}S(u,x,p,i,I){for(i=F[u];I=B[i];I-p?S(I,R[i]*x%M+1,u),x=x*-~D[I]%M:0)i=T[i];P[n-u]=x%M;}main(u,v){for(;~scanf("%d%d",&u,&v);)i++?T[i-1]=F[u],T[i]=F[B[F[u]=i-1]=v],B[F[v]=i++]=u:(n=u,M=v);s(1,F[1]);for(S(1,1);n--;)printf("%d ",P[n]);}
      |                                                                                                                     ^
main.c: In function 'S':
main.c:2:117: error: type of 'u' defaults to 'int' [-Wimplicit-int]
main.c:2:117: error: type of 'x' defaults to 'int' [-Wimplicit-int]
main.c:2:117: error: type of 'p' defaults to 'int' [-Wimplicit-int]
main.c:2:117: error: type of 'i' defaults to 'int' [-Wimplicit-int]
main.c:2:117: error: type of 'I' defaults to 'int' [-Wimplicit-int]
main.c:2:156: error: 'R' undeclared (first use in this function)
    2 | n,i;B _,T _,F _;long M,D _,P _;s(u,i,p,I){P[i]=i?s(u,T[i],p),(I=B[i])-p?s(I,F[I],u),D[u]=D[u]*-~D[I]%M:D[u]:++D[u];}S(u,x,p,i,I){for(i=F[u];I=B[i];I-p?S(I,R[i]*x%M+1,u),x=x*-~D[I]%M:0)i=T[i];P[n-u]=x%M;}main(u,v){for(;~scanf("%d%d",&u,&v);)i++?T[i-1]=F[u],T[i]=F[B[F[u]=i-1]=v],B[F[v]=i++]=u:(n=u,M=v);s(1,F[1]);for(S(1,1);n--;)printf("%d ",P[n]);}
      |                                                                                                                                                            ^
main.c:2:156: note: each undeclared identifier is reported only once for each function it appears in
main.c: At top level:
main.c:2:204: error: return type defaults to 'int' [-Wimplicit-int]
    2 | n,i;B _,T _,F _;long M,D _,P _;s(u,i,p,I){P[i]=i?s(u,T[i],p),(I=B[i])-p?s(I,F[I],u),D[u]=D[u]*-~D[I]%M:D[u]:++D[u];}S(u,x,p,i,I){for(i=F[u];I=B[i];I-p?S(I,R[i]*x%M+1,u),x=x*-~D[I]%M:0)i=T[i];P[n-u]=x%M;}main(u,v){for(;~scanf("%d%d",&u,&v);)i++?T[i-1]=F[u],T[i]=F[B[F[u]=i-1]=v],B[F[v]=i++]=u:(n=u,M=v);s(1,F[1]);for(S(1,1);n--;)printf("%d ",P[n]);}
      |                                                                                                                                                                                                            ^~~~
main.c: In function 'main':
main.c:2:204: error: type of 'u' defaults to 'int' [-Wimplicit-int]
main.c:2:204: error: type of 'v' defaults to 'int' [-Wimplicit-int]
main.c:2:220: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration]
    2 | n,i;B _,T _,F _;long M,D _,P _;s(u,i,p,I){P[i]=i?s(u,T[i],p),(I=B[i])-p?s(I,F[I],u),D[u]=D[u]*-~D[I]%M:D[u]:++D[u];}S(u,x,p,i,I){for(i=F[u];I=B[i];I-p?S(I,R[i]*x%M+1,u),x=x*-~D[I]%M:0)i=T[i];P[n-u]=x%M;}main(u,v){for(;~scanf("%d%d",&u,&v);)i++?T[i-1]=F[u],T[i]=F[B[F[u]=i-1]=v],B[F[v]=i++]=u:(n=u,M=v);s(1,F[1]);for(S(1,1);n--;)printf("%d ",P[n]);}
      |                                                                                                                                                                                                                            ^~~~~
main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf'
  +++ |+#include <stdio.h>
    1 | #define _[2<<17]
main.c:2:220: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch]
    2 | n,i;B _,T _,F _;long M,D _,P _;s(u,i,p,I){P[i]=i?s(u,T[i],p),(I=B[i])-p?s(I,F[I],u),D[u]=D[u]*-~D[I]%M:D[u]:++D[u];}S(u,x,p,i,I){for(i=F[u];I=B[i];I-p?S(I,R[i]*x%M+1,u),x=x*-~D[I]%M:0)i=T[i];P[n-u]=x%M;}main(u,v){for(;~scanf("%d%d",&u,&v);)i++?T[i-1]=F[u],T[i]=F[B[F[u]=i-1]=v],B[F[v]=i++]=u:(n=u,M=v);s(1,F[1]);for(S(1,1);n--;)printf("%d ",P[n]);}
      |                                                                                                                                                                                                                            ^~~~~
main.c:2:220: note: include '<stdio.h>' or provide a declaration of 'scanf'
main.c:2:329: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration]
    2 | n,i;B _,T _,F _;long M,D _,P _;s(u,i,p,I){P[i]=i?s(u,T[i],p),(I=B[i])-p?s(I,F[I],u),D[u]=D[u]*-~D[I]%M:D[u]:++D[u];}S(u,x,p,i,I){for(i=F[u];I=B[i];I-p?S(I,R[i]*x%M+1,u),x=x*-~D[I]%M:0)i=T[i];P[n-u]=x%M;}main(u,v){for(;~scanf("%d%d",&u,&v);)i++?T[i-1]=F[u],T[i]=F[B[F[u]=i-1]=v],B[F[v]=i++]=u:(n=u,M=v);s(1,F[1]);for(S(1,1);n--;)printf("%d ",P[n]);}
      |                                                                                                                                                                                                                                                                                                                                         ^~~~~~
main.c:2:329: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:2:329: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
main.c:2:329: note: include '<stdio.h>' or provide a declaration of 'printf'