#include <iostream>
#include <regex>
#include <stdio.h>
#include <string>

using namespace std;

int main() {
  string S;
  cin >> S;
  regex rx(R"(^A[a-z][a-z]*?C[a-z]*?[a-z]$)");
  if (regex_match(S, rx)) {
    printf("AC\n");
  } else {
    printf("WA\n");
  }
}

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

typedef long long ll;
typedef unsigned long long ull;
typedef double dd;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef pair<int,int> pii;

const int mx=1e6+11;
const double PI = acos(-1);
#define MOD 1000000007


#define nl '\n'
#define pb push_back
#define F first
#define S second
#define I insert
#define mp make_pair

#define sz(x) x.size()
#define tt int t; cin>>t; while(t--)
#define lo(i,a,b) for(int i=a;i<b;i++)
#define rlo(i,n) for(int i=n-1;i>=0;i--)
#define be(a) (a).begin(),(a).end()
#define rbe(a) (a).rbegin(),(a).rend()
#define mem(a,b) memset(a,b,sizeof(a))
#define pr(a) {for(auto x:a)cout<<x<<" ";cout<<nl;}
#define ac cout<<"AC"<<nl
#define wa cout<<"WA"<<nl
#define su ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define file freopen("input.txt","r",stdin);freopen("output.txt","w",stdout);
#define frac cout.unsetf(ios::floatfield); cout.precision(10); cout.setf(ios::fixed,ios::floatfield);

#define dbg(args...) do {cerr << #args << " : "; faltu(args); } while(0)
void faltu () {            cerr << endl;}
template < typename T, typename ... hello>void faltu( T arg, const hello &... rest) {cerr << arg << ' ';faltu(rest...);}

void f()
{
  string s;
  cin>>s;
  int n=sz(s),c=0,C=0,a=0;
  if(s[0]=='A')
  {
    for(int i=1;i<n;i++)
    {
      if(s[i]=='C')
        c++;
    }
    if(c>1||c==0)
      wa;
    else
    {
      for(int i=2;i<n-1;i++)
      {
        if(s[i]=='C')
          C++;
      }
      if(C==1)
      {
        for(int i=1;i<n;i++)
        {
          if(s[i]!='C'&&s[i]>='a'&&s[i]<='z')
            a++;
        }
        if(2+a==n)
          ac;
        else
          wa;
      }
      else
        wa;
    }
  }
  else
    wa;
}

int main()
{
    su;
    ///tt
    f();
    return 0;
}
