public void solve() throws IOException {
    int T = nextInt();
    for (int t = 1; t <= T; t++) {
      int K = nextInt();
      int C = nextInt();
      int S = nextInt();
      
      int minS = (int) Math.ceil(K * 1.0 / C);
      
      if (S >= minS) {
        long[] pow = new long[C];
        pow[0] = 1;
        for (int i = 1; i < C; i++) {
          pow[i] = pow[i - 1] * K;
        }
        
        StringBuilder sb = new StringBuilder();       
        int pos = 0;
        for (int i = 0; i < minS; i++) {
          long query = 1;
          for (int j = 1; j <= C && pos < K; j++, pos++) {
            query += pos * pow[C - j];
          }
          if (sb.length() != 0) {
            sb.append(" ");
          }
          sb.append(query);
        } 
        out.format("Case #%d: %s%n", t, sb.toString());
      } else {
        out.format("Case #%d: IMPOSSIBLE%n", t);
      }
    }
  }