fork download
  1. //package com.codeforces.competitions.year2016.julytoseptember.round368div2;
  2.  
  3. import java.io.*;
  4. import java.util.*;
  5.  
  6. class TaskA
  7. {
  8. public static void main(String[] args)
  9. {
  10. InputReader in = new InputReader(System.in);
  11. OutputWriter out = new OutputWriter(System.out);
  12.  
  13. Solver solver = new Solver(in, out);
  14. solver.solve();
  15.  
  16. out.flush();
  17.  
  18. in.close();
  19. out.close();
  20. }
  21.  
  22. static class Solver
  23. {
  24. int n, m;
  25. InputReader in;
  26. OutputWriter out;
  27.  
  28. void solve()
  29. {
  30. n = in.nextInt();
  31. m = in.nextInt();
  32.  
  33. String[] col = new String[n];
  34.  
  35. for (int i = 0; i < n; i++)
  36. col[i] = in.nextLine();
  37.  
  38. boolean found = false;
  39.  
  40. for (int i = 0; i < n; i++)
  41. {
  42. for (int j = 0; j < 2 * m; j += 2)
  43. {
  44. char c = col[i].charAt(j);
  45.  
  46. if (col[i].charAt(j) == 'C' || c == 'M' || c == 'Y')
  47. found = true;
  48. }
  49. }
  50.  
  51. if (found)
  52. out.println("#Color");
  53. else
  54. out.println("#Black&White");
  55. }
  56.  
  57. public Solver(InputReader in, OutputWriter out)
  58. {
  59. this.in = in;
  60. this.out = out;
  61. }
  62.  
  63. }
  64.  
  65. static class InputReader
  66. {
  67. private InputStream stream;
  68. private byte[] buf = new byte[1024];
  69. private int curChar;
  70. private int numChars;
  71.  
  72. public InputReader(InputStream stream)
  73. {
  74. this.stream = stream;
  75. }
  76.  
  77. public int read()
  78. {
  79. if (numChars == -1)
  80. throw new InputMismatchException();
  81.  
  82. if (curChar >= numChars)
  83. {
  84. curChar = 0;
  85. try
  86. {
  87. numChars = stream.read(buf);
  88. } catch (IOException e)
  89. {
  90. throw new InputMismatchException();
  91. }
  92. if (numChars <= 0)
  93. return -1;
  94. }
  95.  
  96. return buf[curChar++];
  97. }
  98.  
  99. public int nextInt()
  100. {
  101. int c = read();
  102.  
  103. while (isSpaceChar(c))
  104. c = read();
  105.  
  106. int sgn = 1;
  107.  
  108. if (c == '-')
  109. {
  110. sgn = -1;
  111. c = read();
  112. }
  113.  
  114. int res = 0;
  115.  
  116. do
  117. {
  118. if (c < '0' || c > '9')
  119. throw new InputMismatchException();
  120.  
  121. res *= 10;
  122. res += c & 15;
  123.  
  124. c = read();
  125. } while (!isSpaceChar(c));
  126.  
  127. return res * sgn;
  128. }
  129.  
  130. public int[] nextIntArray(int arraySize)
  131. {
  132. int array[] = new int[arraySize];
  133.  
  134. for (int i = 0; i < arraySize; i++)
  135. array[i] = nextInt();
  136.  
  137. return array;
  138. }
  139.  
  140. public long nextLong()
  141. {
  142. int c = read();
  143.  
  144. while (isSpaceChar(c))
  145. c = read();
  146.  
  147. int sign = 1;
  148.  
  149. if (c == '-')
  150. {
  151. sign = -1;
  152.  
  153. c = read();
  154. }
  155.  
  156. long result = 0;
  157.  
  158. do
  159. {
  160. if (c < '0' || c > '9')
  161. throw new InputMismatchException();
  162.  
  163. result *= 10;
  164. result += c & 15;
  165.  
  166. c = read();
  167. } while (!isSpaceChar(c));
  168.  
  169. return result * sign;
  170. }
  171.  
  172. public long[] nextLongArray(int arraySize)
  173. {
  174. long array[] = new long[arraySize];
  175.  
  176. for (int i = 0; i < arraySize; i++)
  177. array[i] = nextLong();
  178.  
  179. return array;
  180. }
  181.  
  182. public float nextFloat() // problematic
  183. {
  184. float result, div;
  185. byte c;
  186.  
  187. result = 0;
  188. div = 1;
  189. c = (byte) read();
  190.  
  191. while (c <= ' ')
  192. c = (byte) read();
  193.  
  194. boolean isNegative = (c == '-');
  195.  
  196. if (isNegative)
  197. c = (byte) read();
  198.  
  199. do
  200. {
  201. result = result * 10 + c - '0';
  202. } while ((c = (byte) read()) >= '0' && c <= '9');
  203.  
  204. if (c == '.')
  205. while ((c = (byte) read()) >= '0' && c <= '9')
  206. result += (c - '0') / (div *= 10);
  207.  
  208. if (isNegative)
  209. return -result;
  210.  
  211. return result;
  212. }
  213.  
  214. public double nextDouble() // not completely accurate
  215. {
  216. double ret = 0, div = 1;
  217. byte c = (byte) read();
  218.  
  219. while (c <= ' ')
  220. c = (byte) read();
  221.  
  222. boolean neg = (c == '-');
  223.  
  224. if (neg)
  225. c = (byte) read();
  226.  
  227. do
  228. {
  229. ret = ret * 10 + c - '0';
  230. } while ((c = (byte) read()) >= '0' && c <= '9');
  231.  
  232. if (c == '.')
  233. while ((c = (byte) read()) >= '0' && c <= '9')
  234. ret += (c - '0') / (div *= 10);
  235.  
  236. if (neg)
  237. return -ret;
  238.  
  239. return ret;
  240. }
  241.  
  242. public String next()
  243. {
  244. int c = read();
  245.  
  246. while (isSpaceChar(c))
  247. c = read();
  248.  
  249. StringBuilder res = new StringBuilder();
  250.  
  251. do
  252. {
  253. res.appendCodePoint(c);
  254.  
  255. c = read();
  256. } while (!isSpaceChar(c));
  257.  
  258. return res.toString();
  259. }
  260.  
  261. public boolean isSpaceChar(int c)
  262. {
  263. return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
  264. }
  265.  
  266. public String nextLine()
  267. {
  268. int c = read();
  269.  
  270. StringBuilder result = new StringBuilder();
  271.  
  272. do
  273. {
  274. result.appendCodePoint(c);
  275.  
  276. c = read();
  277. } while (!isNewLine(c));
  278.  
  279. return result.toString();
  280. }
  281.  
  282. public boolean isNewLine(int c)
  283. {
  284. return c == '\n';
  285. }
  286.  
  287. public void close()
  288. {
  289. try
  290. {
  291. stream.close();
  292. } catch (IOException e)
  293. {
  294. e.printStackTrace();
  295. }
  296. }
  297.  
  298. }
  299.  
  300. static class OutputWriter
  301. {
  302. private PrintWriter writer;
  303.  
  304. public OutputWriter(OutputStream stream)
  305. {
  306. stream)));
  307. }
  308.  
  309. public OutputWriter(Writer writer)
  310. {
  311. this.writer = new PrintWriter(writer);
  312. }
  313.  
  314. public void println(int x)
  315. {
  316. writer.println(x);
  317. }
  318.  
  319. public void print(int x)
  320. {
  321. writer.print(x);
  322. }
  323.  
  324. public void println(char x)
  325. {
  326. writer.println(x);
  327. }
  328.  
  329. public void print(char x)
  330. {
  331. writer.print(x);
  332. }
  333.  
  334. public void println(int array[], int size)
  335. {
  336. for (int i = 0; i < size; i++)
  337. println(array[i]);
  338. }
  339.  
  340. public void print(int array[], int size)
  341. {
  342. for (int i = 0; i < size; i++)
  343. print(array[i] + " ");
  344. }
  345.  
  346. public void println(long x)
  347. {
  348. writer.println(x);
  349. }
  350.  
  351. public void print(long x)
  352. {
  353. writer.print(x);
  354. }
  355.  
  356. public void println(long array[], int size)
  357. {
  358. for (int i = 0; i < size; i++)
  359. println(array[i]);
  360. }
  361.  
  362. public void print(long array[], int size)
  363. {
  364. for (int i = 0; i < size; i++)
  365. print(array[i]);
  366. }
  367.  
  368. public void println(float num)
  369. {
  370. writer.println(num);
  371. }
  372.  
  373. public void print(float num)
  374. {
  375. writer.print(num);
  376. }
  377.  
  378. public void println(double num)
  379. {
  380. writer.println(num);
  381. }
  382.  
  383. public void print(double num)
  384. {
  385. writer.print(num);
  386. }
  387.  
  388. public void println(String s)
  389. {
  390. writer.println(s);
  391. }
  392.  
  393. public void print(String s)
  394. {
  395. writer.print(s);
  396. }
  397.  
  398. public void println()
  399. {
  400. writer.println();
  401. }
  402.  
  403. public void printSpace()
  404. {
  405. writer.print(" ");
  406. }
  407.  
  408. public void printf(String format, Object args)
  409. {
  410. writer.printf(format, args);
  411. }
  412.  
  413. public void flush()
  414. {
  415. writer.flush();
  416. }
  417.  
  418. public void close()
  419. {
  420. writer.close();
  421. }
  422.  
  423. }
  424.  
  425. static class CMath
  426. {
  427. static long power(long number, long power)
  428. {
  429. if (number == 1 || number == 0 || power == 0)
  430. return 1;
  431.  
  432. if (power == 1)
  433. return number;
  434.  
  435. if (power % 2 == 0)
  436. return power(number * number, power / 2);
  437. else
  438. return power(number * number, power / 2) * number;
  439. }
  440.  
  441. static long modPower(long number, long power, long mod)
  442. {
  443. if (number == 1 || number == 0 || power == 0)
  444. return 1;
  445.  
  446. number = mod(number, mod);
  447.  
  448. if (power == 1)
  449. return number;
  450.  
  451. long square = mod(number * number, mod);
  452.  
  453. if (power % 2 == 0)
  454. return modPower(square, power / 2, mod);
  455. else
  456. return mod(modPower(square, power / 2, mod) * number, mod);
  457. }
  458.  
  459. static long moduloInverse(long number, long mod)
  460. {
  461. return modPower(number, mod - 2, mod);
  462. }
  463.  
  464. static long mod(long number, long mod)
  465. {
  466. return number - (number / mod) * mod;
  467. }
  468.  
  469. static int gcd(int a, int b)
  470. {
  471. if (b == 0)
  472. return a;
  473. else
  474. return gcd(b, a % b);
  475. }
  476.  
  477. }
  478.  
  479. }
  480.  
Success #stdin #stdout 0.04s 320576KB
stdin
1 6
C M Y W G B
stdout
#Color