import java.io.IOException; import java.io.InputStream; import java.io.PrintWriter; import java.util.Arrays; import java.util.NoSuchElementException; public class Main { public static void main(String[] args) { new Main().run(); } int pow(int a,int n) { return n!=0?pow(a*a,n/2)*(n%2==1?a:1):1; } int get(int v,int i,int j) { if (i<0||j<0||i>=3||j>=3) return 0; return v/pow(10,i+2*j)%10; } void run() { FastScanner sc=new FastScanner(); int W=sc.nextInt(); int H=sc.nextInt(); int X=sc.nextInt(); assert(1<=W&&W<=600&&1<=H&&H<=600); assert(0<=X&&X<=81); out:for (int v=0;v<10000;++v) { { int cur=v; int sum=0; while (cur>0) { sum+=cur%10; cur/=10; } if (sum!=X) continue out; } for (int i=0;i<=(H-1)%3;++i) { for (int j=0;j<=(W-1)%3;++j) { int sum=0; for (int di=-1;di<=1;++di) { for (int dj=-1;dj<=1;++dj) { int ni=i+di; int nj=j+dj; if (ni>(H-1)%3 || nj>(W-1)%3 || ni<0 || nj<0) continue; sum+=get(v,ni,nj); } } if (sum!=X) continue out; } } PrintWriter pw=new PrintWriter(System.out); for (int i=0;i Integer.MAX_VALUE) throw new NumberFormatException(); return (int) nl; } public double nextDouble() { return Double.parseDouble(next());} }