import std.stdio;void main(){for(char[99]s;gets(&*s);){int n;void f(){s[n]-s[n+1]-68||(n+=2,f);puts=&s[n];}f;}}