class Solution {
public:
string predictPartyVictory(string senate) {
queue<int> my_que_D;
queue<int> my_que_R;
for(int i=0 ; i<senate.size() ;i++)
{
if(senate[i] == 'R') my_que_R.push(i);
if(senate[i] == 'D') my_que_D.push(i);
}
for(int i=0 ; i<senate.size() ;i++)
{
if(my_que_R.size() !=0 && my_que_D.size()!=0)
{
// cout<<i<<' '<<my_que_R.front()<<' '<<my_que_D.front()<<endl;
if(my_que_R.front() == i )
{
my_que_D.pop();
my_que_R.push(my_que_R.front());
my_que_R.pop();
}
if(my_que_D.front() == i )
{
my_que_R.pop();
my_que_D.push(my_que_D.front());
my_que_D.pop();
}
}else break;
if(i==senate.size()-1 && my_que_R.size() !=0 && my_que_D.size()!=0 ) i=-1;
}
// cout<<my_que_R.front()<<' '<<my_que_D.front();
if(my_que_R.size() !=0 && my_que_D.size()==0 ) return "Radiant";
else return "Dire";
}
};