Language: C++


import java.awt.geom.Point2D;
import java.io.*;
import java.math.BigInteger;
import java.util.ArrayDeque;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.Comparator;
import java.util.Deque;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.NoSuchElementException;
import java.util.PriorityQueue;
import java.util.Scanner;
import java.util.Stack;
import java.util.TreeMap;



public class Main {

	static PrintWriter out = new PrintWriter(System.out);
	static FastScanner sc = new FastScanner();
	static Scanner stdIn = new Scanner(System.in);
	static int INF = 2 << 26;
	static int[][] X = new int[][] {{0,0,0},{0,0,255},{0,255,0},{0,255,255},{255,0,0},{255,0,255},{255,255,0},{255,255,255}};
	static String[] K = new String[] {"black","blue","lime","aqua","red","fuchsia","yellow","white"};
	public static void main(String[] args) {
		while(true) {
			String tmp = sc.next();
			if(tmp.equals("0")) break;
			int a1 = Integer.parseInt(tmp.substring(1, 3),16);
			int a2 = Integer.parseInt(tmp.substring(3, 5),16);
			int a3 = Integer.parseInt(tmp.substring(5, 7),16);
			double dkMax = Double.MAX_VALUE;
			int id = 0;
			for(int i = 0; i < X.length; i++) {
				double x = Math.sqrt(Math.pow((a1 - X[i][0]),2) + Math.pow((a2 - X[i][1]),2) +Math.pow((a3 - X[i][2]),2));
				if(dkMax > x) {
					dkMax = x;
					id = i;
				}
			}
			out.println(K[id]);
			
		}
		out.flush();
	}

}

//------------------------------//
//-----------//
class FastScanner {
    private final InputStream in = System.in;
    private final byte[] buffer = new byte[1024];
    private int ptr = 0;
    private int buflen = 0;
    private boolean hasNextByte() {
        if (ptr < buflen) {
            return true;
        }else{
            ptr = 0;
            try {
                buflen = in.read(buffer);
            } catch (IOException e) {
                e.printStackTrace();
            }
            if (buflen <= 0) {
                return false;
            }
        }
        return true;
    }
    private int readByte() { if (hasNextByte()) return buffer[ptr++]; else return -1;}
    private static boolean isPrintableChar(int c) { return 33 <= c && c <= 126;}
    private void skipUnprintable() { while(hasNextByte() && !isPrintableChar(buffer[ptr])) ptr++;}
    public boolean hasNext() { skipUnprintable(); return hasNextByte();}
    public String next() {
        if (!hasNext()) throw new NoSuchElementException();
        StringBuilder sb = new StringBuilder();
        int b = readByte();
        while(isPrintableChar(b)) {
            sb.appendCodePoint(b);
            b = readByte();
        }
        return sb.toString();
    }
    public long nextLong() {
        if (!hasNext()) throw new NoSuchElementException();
        long n = 0;
        boolean minus = false;
        int b = readByte();
        if (b == '-') {
            minus = true;
            b = readByte();
        }
        if (b < '0' || '9' < b) {
            throw new NumberFormatException();
        }
        while(true){
            if ('0' <= b && b <= '9') {
                n *= 10;
                n += b - '0';
            }else if(b == -1 || !isPrintableChar(b)){
                return minus ? -n : n;
            }else{
                throw new NumberFormatException();
            }
            b = readByte();
        }
    }
    
    public int nextInt() {
    	 if (!hasNext()) throw new NoSuchElementException();
         int n = 0;
         boolean minus = false;
         int b = readByte();
         if (b == '-') {
             minus = true;
             b = readByte();
         }
         if (b < '0' || '9' < b) {
             throw new NumberFormatException();
         }
         while(true){
             if ('0' <= b && b <= '9') {
                 n *= 10;
                 n += b - '0';
             }else if(b == -1 || !isPrintableChar(b)){
                 return minus ? -n : n;
             }else{
                 throw new NumberFormatException();
             }
             b = readByte();
         }
    }
    
    public double nextDouble() {
    	return Double.parseDouble(next());
    }
    

}

Compiler output:
a.cc:2:1: error: 'import' does not name a type
    2 | import java.awt.geom.Point2D;
      | ^~~~~~
a.cc:2:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:3:1: error: 'import' does not name a type
    3 | import java.io.*;
      | ^~~~~~
a.cc:3:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:4:1: error: 'import' does not name a type
    4 | import java.math.BigInteger;
      | ^~~~~~
a.cc:4:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:5:1: error: 'import' does not name a type
    5 | import java.util.ArrayDeque;
      | ^~~~~~
a.cc:5:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:6:1: error: 'import' does not name a type
    6 | import java.util.ArrayList;
      | ^~~~~~
a.cc:6:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:7:1: error: 'import' does not name a type
    7 | import java.util.Arrays;
      | ^~~~~~
a.cc:7:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:8:1: error: 'import' does not name a type
    8 | import java.util.Collections;
      | ^~~~~~
a.cc:8:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:9:1: error: 'import' does not name a type
    9 | import java.util.Comparator;
      | ^~~~~~
a.cc:9:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:10:1: error: 'import' does not name a type
   10 | import java.util.Deque;
      | ^~~~~~
a.cc:10:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:11:1: error: 'import' does not name a type
   11 | import java.util.HashMap;
      | ^~~~~~
a.cc:11:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:12:1: error: 'import' does not name a type
   12 | import java.util.HashSet;
      | ^~~~~~
a.cc:12:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:13:1: error: 'import' does not name a type
   13 | import java.util.List;
      | ^~~~~~
a.cc:13:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:14:1: error: 'import' does not name a type
   14 | import java.util.NoSuchElementException;
      | ^~~~~~
a.cc:14:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:15:1: error: 'import' does not name a type
   15 | import java.util.PriorityQueue;
      | ^~~~~~
a.cc:15:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:16:1: error: 'import' does not name a type
   16 | import java.util.Scanner;
      | ^~~~~~
a.cc:16:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:17:1: error: 'import' does not name a type
   17 | import java.util.Stack;
      | ^~~~~~
a.cc:17:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:18:1: error: 'import' does not name a type
   18 | import java.util.TreeMap;
      | ^~~~~~
a.cc:18:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:22:1: error: expected unqualified-id before 'public'
   22 | public class Main {
      | ^~~~~~
a.cc:57:12: error: expected ':' before 'final'
   57 |     private final InputStream in = System.in;
      |            ^~~~~~
      |            :
a.cc:57:13: error: 'final' does not name a type
   57 |     private final InputStream in = System.in;
      |             ^~~~~
a.cc:58:12: error: expected ':' before 'final'
   58 |     private final byte[] buffer = new byte[1024];
      |            ^~~~~~
      |            :
a.cc:58:13: error: 'final' does not name a type
   58 |     private final byte[] buffer = new byte[1024];
      |             ^~~~~
a.cc:59:12: error: expected ':' before 'int'
   59 |     private int ptr = 0;
      |            ^~~~
      |            :
a.cc:60:12: error: expected ':' before 'int'
   60 |     private int buflen = 0;
      |            ^~~~
      |            :
a.cc:61:12: error: expected ':' before 'boolean'
   61 |     private boolean hasNextByte() {
      |            ^~~~~~~~
      |            :
a.cc:61:13: error: 'boolean' does not name a type; did you mean 'bool'?
   61 |     private boolean hasNextByte() {
      |             ^~~~~~~
      |             bool
a.cc:77:12: error: expected ':' before 'int'
   77 |     private int readByte() { if (hasNextByte()) return buffer[ptr++]; else return -1;}
      |            ^~~~
      |            :
a.cc:78:12: error: expected ':' before 'static'
   78 |     private static boolean isPrintableChar(int c) { return 33 <= c && c <= 126;}
      |            ^~~~~~~
      |            :
a.cc:78:20: error: 'boolean' does not name a type; did you mean 'bool'?
   78 |     private static boolean isPrintableChar(int c) { return 33 <= c && c <= 126;}
      |                    ^~~~~~~
      |                    bool
a.cc:79:12: error: expected ':' before 'void'
   79 |     private void skipUnprintable() { while(hasNextByte() && !isPrintableChar(buffer[ptr])) ptr++;}
      |            ^~~~~
      |            :
a.cc:80:11: error: expected ':' before 'boolean'
   80 |     public boolean hasNext() { skipUnprintable(); return hasNextByte();}
      |           ^~~~~~~~
      |           :
a.cc:80:12: error: 'boolean' does not name a type; did you mean 'bool'?
   80 |     public boolean hasNext() { skipUnprintable(); return hasNextByte();}
      |            ^~~~~~~
      |            bool
a.cc:81:11: error: expected ':' before 'String'
   81 |     public String next() {
      |           ^~~~~~~
      |           :
a.cc:81:12: error: 'String' does not name a type
   81 |     public String next() {
      |            ^~~~~~
a.cc:91:11: error: expected ':' before 'long'
   91 |     public long nextLong() {
      |           ^~~~~
      |           :
a.cc:116:11: error: expected ':' before 'int'
  116 |     public int nextInt() {
      |           ^~~~
      |           :
a.cc:141:11: error: expected ':' before 'double'
  141 |     public double nextDouble() {
      |           ^~~~~~~
      |           :
a.cc:146:2: error: expected ';' after class definition
  146 | }
      |  ^
      |  ;
a.cc: In member function 'int FastScanner::readByte()':
a.cc:77:34: error: 'hasNextByte' was not declared in this scope
   77 |     private int readByte() { if (hasNextByte()) return buffer[ptr++]; else return -1;}
      |                                  ^~~~~~~~~~~
a.cc:77:56: error: 'buffer' was not declared in this scope; did you mean 'buflen'?
   77 |     private int readByte() { if (hasNextByte()) return buffer[ptr++]; else return -1;}
      |                                                        ^~~~~~
      |                                                        buflen
a.cc: In member function 'void FastScanner::skipUnprintable()':
a.cc:79:44: error: 'hasNextByte' was not declared in this scope
   79 |     private void skipUnprintable() { while(hasNextByte() && !isPrintableChar(buffer[ptr])) ptr++;}
      |                                            ^~~~~~~~~~~
a.cc:79:78: error: 'buffer' was not declared in this scope; did you mean 'buflen'?
   79 |     private void skipUnprintable() { while(hasNextByte() && !isPrintableChar(buffer[ptr])) ptr++;}
      |                                                                              ^~~~~~
      |                                                                              buflen
a.cc:79:62: error: 'isPrintableChar' was not declared in this scope
   79 |     private void skipUnprintable() { while(hasNextByte() && !isPrintableChar(buffer[ptr])) ptr++;}
      |                                                              ^~~~~~~~~~~~~~~
a.cc: In member function 'long int FastScanner::nextLong()':
a.cc:92:14: error: 'hasNext' was not declared in this scope
   92 |         if (!hasNext()) throw new NoSuchElementException();
      |              ^~~~~~~
a.cc:92:35: error: expected type-specifier before 'NoSuchElementException'
   92 |         if (!hasNext()) throw new NoSuchElementException();
      |                                   ^~~~~~~~~~~~~~~~~~~~~~
a.cc:94:9: error: 'boolean' was not declared in this scope; did you mean 'bool'?
   94 |         boolean minus = false;
      |         ^~~~~~~
      |         bool
a.cc:97:13: error: 'minus' was not declared in this scope
   97 |             minus = true;
      |             ^~~~~
a.cc:101:23: error: expected type-specifier before 'NumberFormatException'
  101 |             throw new NumberFormatException();
      |                       ^~~~~~~~~~~~~~~~~~~~~
a.cc:107:34: error: 'isPrintableChar' was not declared in this scope
  107 |             }else if(b == -1 || !isPrintableChar(b)){
      |                                  ^~~~~~~~~~~~~~~
a.cc:108:24: error: 'minus' was not declared in this scope
  108 |                 return minus ? -n : n;
      |                        ^~~~~
a.cc:110:27: error: expected type-specifier before 'NumberFormatException'
  110 |                 throw new NumberFormatException();
      |                           ^~~~~~~~~~~~~~~~~~~~~
a.cc: In member function 'int FastScanner::nextInt()':
a.cc:117:15: error: 'hasNext' was not declared in this scope
  117 |          if (!hasNext()) throw new NoSuchElementException();
      |               ^~~~~~~
a.cc:117:36: error: expected type-specifier before 'NoSuchElementException'
  117 |          if (!hasNext()) throw new NoSuchElementException();
      |                                    ^~~~~~~~~~~~~~~~~~~~~~
a.cc:119:10: error: 'boolean' was not declared in this scope; did you mean 'bool'?
  119 |          boolean minus = false;
      |          ^~~~~~~
      |          bool
a.cc:122:14: error: 'minus' was not declared in this scope
  122 |              minus = true;
      |              ^~~~~
a.cc:126:24: error: expected type-specifier before 'NumberFormatException'
  126 |              throw new NumberFormatException();
      |                        ^~~~~~~~~~~~~~~~~~~~~
a.cc:132:35: error: 'isPrintableChar' was not declared in this scope
  132 |              }else if(b == -1 || !isPrintableChar(b)){
      |                                   ^~~~~~~~~~~~~~~
a.cc:133:25: error: 'minus' was not declared in this scope
  133 |                  return minus ? -n : n;
      |                         ^~~~~
a.cc:135:28: error: expected type-specifier before 'NumberFormatException'
  135 |                  throw new NumberFormatException();
      |