#[allow(unused_macros, dead_code)]
macro_rules! input {
    (source = $s:expr, $($r:tt)*) => {
        let mut iter = $s.split_whitespace();
        let mut next = || { iter.next().unwrap() };
        input_inner!{next, $($r)*}
    };
    ($($r:tt)*) => {
        let stdin = std::io::stdin();
        let mut bytes = std::io::Read::bytes(std::io::BufReader::new(stdin.lock()));
        let mut next = move || -> String{
            bytes
                .by_ref()
                .map(|r|r.unwrap() as char)
                .skip_while(|c|c.is_whitespace())
                .take_while(|c|!c.is_whitespace())
                .collect()
        };
        input_inner!{next, $($r)*}
    };
}

#[allow(unused_macros, dead_code)]
macro_rules! input_inner {
    ($next:expr) => {};
    ($next:expr, ) => {};

    ($next:expr, $var:ident : $t:tt $($r:tt)*) => {
        let $var = read_value!($next, $t);
        input_inner!{$next $($r)*}
    };

    ($next:expr, mut $var:ident : $t:tt $($r:tt)*) => {
        let mut $var = read_value!($next, $t);
        input_inner!{$next $($r)*}
    };
}

#[allow(unused_macros, dead_code)]
macro_rules! read_value {
    ($next:expr, ( $($t:tt),* )) => {
        ( $(read_value!($next, $t)),* )
    };

    ($next:expr, [ $t:tt ; $len:expr ]) => {
        (0..$len).map(|_| read_value!($next, $t)).collect::<Vec<_>>()
    };

    ($next:expr, chars) => {
        read_value!($next, String).chars().collect::<Vec<char>>()
    };

    ($next:expr, bytes) => {
        read_value!($next, String).into_bytes()
    };

    ($next:expr, usize1) => {
        read_value!($next, usize) - 1
    };

    ($next:expr, $t:ty) => {
        $next().parse::<$t>().expect("Parse error")
    };
}

#[allow(dead_code)]
struct UnionFind {
    parent: Vec<usize>,
    rank: Vec<usize>,
    size: Vec<usize>,
}

#[allow(dead_code)]
impl UnionFind {
    fn new(n: usize) -> UnionFind {
        let mut p = vec![0; n];
        for i in 0..n {
            p[i] = i;
        }
        return UnionFind {
            parent: p,
            rank: vec![0; n],
            size: vec![1; n],
        };
    }

    fn find(&mut self, x: usize) -> usize {
        if x == self.parent[x] {
            x
        } else {
            let p = self.parent[x];
            let pr = self.find(p);
            self.parent[x] = pr;
            pr
        }
    }

    fn same(&mut self, a: usize, b: usize) -> bool {
        self.find(a) == self.find(b)
    }

    fn unite(&mut self, a: usize, b: usize) {
        let a_root = self.find(a);
        let b_root = self.find(b);
        if a_root == b_root {
            return;
        }
        if self.rank[a_root] > self.rank[b_root] {
            self.parent[b_root] = a_root;
            self.size[a_root] += self.size[b_root];
        } else {
            self.parent[a_root] = b_root;
            self.size[b_root] += self.size[a_root];
            if self.rank[a_root] == self.rank[b_root] {
                self.rank[b_root] += 1;
            }
        }
    }

    fn get_size(&mut self, x: usize) -> usize {
        let root = self.find(x);
        self.size[root]
    }
}

const MOD_P: usize = 1000000007;

#[allow(dead_code)]
// fact(n) = n! mod p
fn fact(n: usize) -> usize {
    let mut acc = 1;
    for i in 1..n + 1 {
        acc = acc * i % MOD_P;
    }
    acc
}

#[allow(dead_code)]
fn mod_pow(b: usize, mut e: usize) -> usize {
    let mut base = b;
    let mut acc = 1;

    while e > 1 {
        if e % 2 == 1 {
            acc = acc * base % MOD_P;
        }
        e /= 2;
        base = base * base % MOD_P;
    }

    if e == 1 {
        acc = acc * base % MOD_P;
    }

    acc
}

#[allow(dead_code)]
fn comb(n: usize, r: usize) -> usize {
    // nCr = n! / (r! (n-r)!) = n! (r!)^(p-2) ((n-r)!)^(p-2)
    let x = ((n - r + 1)..(n + 1)).fold(1, |p, x| p * x % MOD_P);
    let y = mod_pow(fact(r), MOD_P - 2);
    x * y % MOD_P
}

#[allow(dead_code)]
fn gcd(a: usize, b: usize) -> usize {
    if b > a {
        gcd(b, a)
    } else if a % b == 0 {
        b
    } else {
        gcd(b, a % b)
    }
}

#[allow(dead_code)]
fn getline() -> String {
    let mut __ret = String::new();
    std::io::stdin().read_line(&mut __ret).ok();
    return __ret;
}

use std::cmp::{max, min};

fn main() {
    input! {
        s: chars,
    }
    let a = s[0] == 'A';
    let b = (2..(s.len() - 1)).fold(0, |acc, x| if s[x] == 'C' { acc + 1 } else { acc }) == 1;
    let c = s.iter().fold(0, |acc, &x| {
        acc + if 'a' as u8 <= x as u8 && x as u8 <= 'z' as u8 {
            1
        } else {
            0
        }
    }) == s.len() - 2;
    let ans = if a && b && c { "AC" } else { "WA" };
    println!("{}", ans);
}


use std::io::*;
use std::str::FromStr;

pub fn read<T: FromStr>() -> T {
    let stdin = stdin();
    let stdin = stdin.lock();
    let token: String = stdin
        .bytes()
        .map(|c| c.expect("failed to read char") as char)
        .skip_while(|c| c.is_whitespace())
        .take_while(|c| !c.is_whitespace())
        .collect();
    token.parse().ok().expect("failed to parse token")
}

fn main() {
    let s: Vec<char> = read::<String>().chars().collect();

    if s[0] != 'A' {
        println!("WA");
        return;
    }

    let res = find_index(&s, 'C');
    if res.0 != 1 {
        println!("WA");
        return;
    }

    if !check_lower_case(&s, res.1) {
        println!("WA");
        return;
    }
    println!("AC");
}

fn check_lower_case(s: &Vec<char>, skip: usize) -> bool {
    for i in 1..s.len() {
        if i == skip {
            continue;
        }
        if !s[i].is_lowercase() {
            return false;
        }
    }
    return true;
}

fn find_index(s: &Vec<char>, t: char) -> (usize, usize) {
    // cnt index
    let mut cnt = 0;
    let mut idx = 0;
    for i in 0..s.len() {
        if i < 2 || i == s.len() - 1 {
            continue;
        }
        if s[i] == t {
            idx = i;
            cnt += 1;
        }
    }

    return (cnt, idx);
}


use std::io;

fn main() {
	let mut buf = String::new();
	io::stdin().read_line(&mut buf).expect("");
	let s:Vec<char> = buf.trim().chars().collect();
	let mut flag = false;
	let mut cnt = 0;
	let mut c = 0;
	/*for i in 0..s.len() {
		println!("{}", (s[i] as i16) - ('A' as i16));
	}*/
	if s[0] == 'A' {
		//if s.len() != 4 {
			for i in 2..(s.len() - 1) {
				if s[i] == 'C' {
					cnt += 1;
					c = i;
				}
				if cnt > 1 {
					break;
				}
			}
			if cnt == 1 {
				for i in 1..s.len() {
					if (s[i] as i32) - ('A' as i32) <= 25 && c != i {
							break;
					}
					if i == s.len() - 1 {
						flag = true;
					}
				}
			}
		//}
	}
	if flag {
		println!("AC");
	}else{
		println!("WA");
	}
}


use std::io::*;
use std::str::FromStr;

pub fn read<T: FromStr>() -> T {
    let stdin = stdin();
    let stdin = stdin.lock();
    let token: String = stdin
        .bytes()
        .map(|c| c.expect("failed to read char") as char)
        .skip_while(|c| c.is_whitespace())
        .take_while(|c| !c.is_whitespace())
        .collect();
    token.parse().ok().expect("failed to parse token")
}

fn main() {
    let s: Vec<char> = read::<String>().chars().collect();

    if s[0] != 'A' {
        println!("WA");
        return;
    }

    let res = find_index(&s, 'C');
    if res.0 != 1 {
        println!("WA");
        return;
    }

    if !check_lower_case(&s, res.1) {
        println!("WA");
        return;
    }
    println!("AC");
}

fn check_lower_case(s: &Vec<char>, skip: usize) -> bool {
    for i in 0..s.len() {
        if i < 2 || i >= s.len() - 1 {
            continue;
        }
        if i == skip {
            continue;
        }
        if !s[i].is_lowercase() {
            return false;
        }
    }
    return true;
}

fn find_index(s: &Vec<char>, t: char) -> (usize, usize) {
    // cnt index
    let mut cnt = 0;
    let mut idx = 0;
    for i in 0..s.len() {
        if i < 2 || i >= s.len() - 1 {
            continue;
        }
        if s[i] == t {
            idx = i;
            cnt += 1;
        }
    }

    return (cnt, idx);
}


use std::io::*;
use std::str::FromStr;

pub fn read<T: FromStr>() -> T {
    let stdin = stdin();
    let stdin = stdin.lock();
    let token: String = stdin
        .bytes()
        .map(|c| c.expect("failed to read char") as char)
        .skip_while(|c| c.is_whitespace())
        .take_while(|c| !c.is_whitespace())
        .collect();
    token.parse().ok().expect("failed to parse token")
}

fn main() {
    let s: Vec<char> = read::<String>().chars().collect();

    if s[0] != 'A' {
        println!("WA");
        return;
    }

    let res = find_index(&s, 'C');
    if res.0 != 1 {
        println!("WA");
        return;
    }

    if !check_lower_case(&s, res.1) {
        println!("WA");
        return;
    }
    println!("AC");
}

fn check_lower_case(s: &Vec<char>, skip: usize) -> bool {
    for i in 0..s.len() {
        if i < 2 || i >= s.len() - 1 {
            continue;
        }
        if i == skip {
            continue;
        }
        if s[i].to_lowercase().to_string() != s[i].to_string() {
            return false;
        }
    }
    return true;
}

fn find_index(s: &Vec<char>, t: char) -> (usize, usize) {
    // cnt index
    let mut cnt = 0;
    let mut idx = 0;
    for i in 0..s.len() {
        if i < 2 || i >= s.len() - 1 {
            continue;
        }
        if s[i] == t {
            idx = i;
            cnt += 1;
        }
    }

    return (cnt, idx);
}