#include <iostream>
using namespace std;

bool check(string S){
  if(S[0]!='A') return false;
  int C=0;
  for (int i = 2 ; i < S.length()-1; i++) {
    if(S[i]=='C'){
      C++;
    }
  }
  if(C!=1) return false;
  int upper=0;
  for (int i = 0; i < S.length(); i++) {
    if(S[i]>='A'&&S[i]<='Z'){
      upper++;
    }
  }
  if(upper!=2) return false;
  return true;
}

int main(){
  string S;
  cin >> S;
  if(check(S)){
    cout << "AC" << endl;
  } else {
    cout << "WA" << endl;
  }
}

#include <iostream>
#include <string>
#include <algorithm>
#include <math.h>
using namespace std;

void b_accepted(void) {
	string s;
	cin >> s;
	bool judge_a = false, judge_b = false, judge_c = false;

	int cnt_c = 0;
	for (int i = 0; i < s.size(); i++) {
		if (i == 0) {
			if (s[i] == 'A') judge_a = true;
			else             break;
		}
		else if (s[i] == 'C'){
			if (i >= 2 && i < s.size() - 1) {
				cnt_c++;
			}
		}
		else {
			if (s[i] < 'a') {
				judge_c = false;
				break;
			}
			else judge_c = true;
		}
	}

	if (cnt_c == 1) judge_b = true;

	if (judge_a & judge_b & judge_c) {
		cout << "AC" << endl;
	}
	else {
		cout << "WA" << endl;
	}
}

int main()
{
	b_accepted();
    return 0;
}