1 #include <iostream>
   2 #include <sstream>
   3 #include <string>
   4 #include <algorithm>
   5 #include <vector>
   6 using namespace std;
   7 
   8 #define GI ({int _t; scanf("%d", &_t); _t;})
   9 #define FOR(i, a, b) for (int i=a; i<b; i++)
  10 #define REP(i, a) FOR(i, 0, a)
  11 template<class T> string toString(T n){ostringstream ost;ost<<n;ost.flush();return ost.str();}
  12 int toInt(string s){int r=0;istringstream sin(s);sin>>r;return r;}
  13 #define DBG(x) cout << #x << "::" << x << endl;
  14 #define DBGV(_v) { REP(_i, _v.size()) { cout << _v[_i] << "\t";} cout << endl;}
  15 
  16 int main() {
  17 	int a, b, c, kase = 0;
  18 	while (1) {
  19 		kase++;
  20 		scanf("%d%d%d", &a, &b, &c);
  21 		if ( a== 0 && b == 0 && c==0) break;
  22 		printf("Case %d:\n", kase);
  23 		int len = ((c+1)*b)+(c*a);
  24 		// cout << len << endl;
  25 		REP(i, b) {
  26 			REP(j, len) {
  27 				printf("*");
  28 			}
  29 			printf("\n");
  30 		}
  31 		REP(l, c) {
  32 			REP(i, a) {
  33 				REP(j, c) {
  34 					REP(k, b) { printf("*"); }
  35 					REP(k, a) { printf("."); }
  36 				}
  37 				REP(k, b) { printf("*"); }
  38 				printf("\n");
  39 			}
  40 			REP(i, b) {
  41 				REP(j, len) {
  42 					printf("*");
  43 				}
  44 				printf("\n");
  45 			}
  46 		}
  47 		printf("\n");
  48 	}
  49 	return 0;
  50 }