#include <bits/stdc++.h>
using namespace std;
  
// #define int long long
#define pb push_back
#define print(Target) cout << Target << '\n'

#define REP(i, n) for (int i = 0; i < (n); i++)
#define REPS(i, a, n) for (int i = (a); i < (n); i++)

typedef long long ll;
typedef unsigned long long ull;
typedef vector<int> vi;
typedef vector<vector<int> > vii;
typedef pair<int, int> pii;

bool is_uruu(int y) {return (y % 4 == 0 && (y % 100 != 0 || y % 400 == 0));}

struct COL{
  double n;
  string name;
};

const int c[8][3] = {{0, 0, 0}, {0, 0, 0xff}, {0, 0xff, 0}, {0, 0xff, 0xff}, {0xff, 0, 0}, {0xff, 0, 0xff}, {0xff, 0xff, 0}, {0xff, 0xff, 0xff}};

const string s[] = {"black", "blue", "lime", "aqua", "red", "fuchsia", "yellow", "white"};

bool cmp(COL lhs, COL rhs)
{
  return (lhs.n < rhs.n);
}

signed main()
{
  //ios::sync_with_stdio(false);
  char sr[2], sg[2], sb[2];
  char sh;
    
  while (scanf("%1s", &sh), sh != '0'){
    COL col[8];
    scanf("%2s%2s%2s", sr, sg, sb);
    int r = strtol(sr, NULL, 16),
        g = strtol(sg, NULL, 16),
        b = strtol(sb, NULL, 16);

    REP(i, 8){
      col[i].n = sqrt((c[i][0] - r) * (c[i][0] - r) + (c[i][1] - g) * (c[i][1] - g) + (c[i][2] - b) * (c[i][2] - b));
      col[i].name = s[i];
    }

    sort(col, col + 8, cmp);
    print(col[0].name);
  }

  return (0);
}