import std.stdio;
import std.conv;
import std.string;
import std.typecons;
import std.algorithm;
import std.array;
import std.range;
import std.math;
import std.regex : regex;
import std.container;

double color (int[] c1, int[] c2) {
  return sqrt((c1[0] - c2[0]).to!float^^2 + (c1[1] - c2[1])^^2 + (c1[2] - c2[2])^^2);
}

void main()
{
  auto col = ["black", "blue", "lime", "aqua", "red", "fuchsia", "yellow", "white"];
  auto rgb = [[0, 0, 0],
              [0, 0, 255],
              [0, 255, 0],
              [0, 255, 255],
              [255, 0, 0],
              [255, 0, 255],
              [255, 255, 0],
              [255, 255, 255]
             ];
	foreach (line; stdin.byLine) {
    auto x = line.chomp;
    if (x == "0") break;
    auto a = x[1..$].map!(x => x >= 'a' ? x - 'a' + 11 : x - '0').array;
    int c[3];
    foreach (i; 0..3) {
      c[i] = a[i*2] * 16 + a[i*2+1];
    }
    auto maxi = double.max;
    string name;
    foreach (i, e; rgb) {
      auto t = color(c, e);
      if (t < maxi) {
        maxi = t;
        name = col[i];
      }
    }
    name.writeln;
  }
}