#include<cassert>
#include<cstdio>
#include<vector>
#include<cmath>
#include<iostream>
#include<algorithm>

#define deb(x) cerr<<#x<<'='<<(x)<<endl

#pragma comment(linker, "/STACK:63000000")

using namespace std;

typedef long long ll;
typedef long long int64;
typedef long double ld;

#define forn(i,n) for(int i = 0; i<(int)(n); ++i)
#define mp() make_pair()

const int N =(int)1e6;
int x[N];

const int K=20;

char s[K+1][K+1];
char tmp[K+1][K+1];

void push(int x,int cl0,int cl1,int type)
{
  int y0=18,y1=18;
  int x0=x, x1=x+1;
  if(type == 1)     
  { 
    x1 = x; 
    y1 = y0 -1;
  }
  if(type == 2)
    swap(x0,x1);
  if(type == 3)
  { 
    x1 = x;
    y0 = y1 - 1;
  }
  s[y0][x0]=cl0+'0';
  s[y1][x1]=cl1+'0';
}

void fall()
{
  forn(T,K) 
    forn(i,K-1)
      forn(j,K) 
       if(s[i][j]=='.' && s[i][j]!=s[i+1][j])
         swap(s[i][j],s[i+1][j]);
}

int clr[K+1][K+1];
int cnt[K*K];
int dx[4]={1,-1,0,0};
int dy[4]={0,0,1,-1};

bool good(int x,int y)
{
  return x>=0 && x<K && y>=0&&y<K;
}

void dfs(int x,int y,int color)
{
  if(clr[x][y]==-1 && isdigit(s[x][y]))
  {
    clr[x][y]=color;
    cnt[color]++;
    forn(i,4)
      if(good(x+dx[i],y+dy[i]) && s[x+dx[i]][y+dy[i]] == s[x][y])
        dfs(x+dx[i],y+dy[i],color);
  }
}

int del()
{
  memset(clr,-1,sizeof clr);
  memset(cnt,0, sizeof cnt);
  int color=0,ans=0;
  forn(i,K)
    forn(j,K)
      if(clr[i][j]==-1&&isdigit(s[i][j])) 
        dfs(i,j,color++);
  forn(i,color)
    if(cnt[i]>=4) 
      ans--;
  forn(i,K)
    forn(j,K)
    {
      if(s[i][j]=='*')
        forn(g,4)
          if(good(i+dx[g],j+dy[g]) && cnt[clr[i+dx[g]][j+dy[g]]]>=4)
          {
            s[i][j]='.';
            break; 
          }
      if(cnt[clr[i][j]]>=4)
      {
        s[i][j]='.';
        ans++;
      }
        
    }

  if(ans == 0)
    return ans;
  return ans-2;
}
int w = 8, h = 16, x0;

bool ins(int x,int y)
{
  return x>=0 && x<h && y>=0 && y<w;
}

int q[8*16+1];
int lav[8]={0,0,3,6,12,24,50,100};

int move(int x,int cl0,int cl1,int type)
{ 
  int clnt=0,ans=0;
  push(x,cl0,cl1,type);
  fall();

  forn(i,K)
    forn(j,K)
      if((isdigit(s[i][j]) || s[i][j]=='*')
            &&( i>=h || j>=w))
        return -(1<<30); 

  while(true)
  {
    int tmp=del();
    if(tmp==0)
      break;
    ans+=tmp;
    if(clnt<7)
      clnt++;
    fall();
  }

  memset(cnt,0,sizeof cnt);
  memset(q,0,sizeof q);
  int sos=0;

  forn(i,h)
    forn(j,w)
    { 
      int col =  clr[i][j];
      if (col < 0)
        continue;

      q[col]++;

      if (ins(i-1,j-1))
        {
          if (s[i-1][j-1]=='.')
            cnt[col]++;
          if (s[i-1][j-1]=='*')
            q[col]++;
        }  
      if (ins(i+1,j))
        {
          if (s[i+1][j]=='.')
            cnt[col]++;
          if (s[i+1][j]=='*')
            q[col]++;
        }  
    }
  forn(i,8*16)
    sos+=cnt[i]*q[i]; 

  return 10*(ans+lav[clnt]) + sos;
}
void out()
{
  forn(i,K)
    fprintf(stderr,"%s\n",s[i]);
  puts("");
}
int main()
{                         
        for(int Test = 0 ; ; ++Test)
        {
                char str[100];
                scanf("%s",str);

                if(!strcmp(str,"Quit"))
                  return 0;

                if(!strcmp(str,"Start")) {
                        scanf("%d", &x[0]);
                        forn(i,N-1)
                          x[i+1]=(((long long)x[i])*17235617 + 4311271)%87465851;
                        printf("Fast Good Old Looser\n");
                        fflush(stdout);
                }
                else if(!strcmp(str,"Move")) {
                  forn(i,h) 
                    scanf(" %s",(tmp[h-i-1]));

                  forn(i,K)
                    forn(j,K)
                      if(i>=h||j>=w)
                        tmp[i][j]='.';

                  /*forn(i,K)
                    forn(j,K)
                      if(tmp[i][j]!='*' && Test!=1)
                        assert(tmp[i][j]==s[i][j]);*/
   
                  forn(i,h)
                    scanf(" %*s");

//                  int ans=0,a=rand()%(w-1),b=0;
                  int ans=-100,a=0,b=0;
                   forn(i,w)
                    forn(type,4)
                    {
                      memcpy(s,tmp,sizeof tmp);
                      int f=move(i,x[Test*2-2]%5+1,x[Test*2-1]%5+1,type);
                      if(f>ans)
                      {
                        ans=f;
                        a=i;
                        b=type;
                      }
                    }
                  assert(a>=0&&a<w);

                  memcpy(s,tmp, sizeof tmp);
                  move(a,x[Test*2-2]%5+1,x[Test*2-1]%5+1,b);
                  printf("%d %d\n",a,b);

                  fflush(stdout);
                }
/*                else 
                {
                  assert(0);
                  fflush(stdout);
                }
*/
        } 

        return 0;
}
