import java.io.BufferedReader;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.util.Scanner;

/**
 * Reads a file containing JavaFX color names and the corresponding RGB values, and 
 * outputs the names and RGB values for relatively bright shades of red.
 * 
 * Using scanner to read formatted input.
 * 
 * @author Drue Coles
 */
public class ShadesOfRed {

    public static void main(String[] args) throws FileNotFoundException {

        String inFileName = "colors.txt";
        try (Scanner in = new Scanner(new BufferedReader(new FileReader(inFileName)))) {
            while (in.hasNext()) {
                
                // Read a color name and RGB values (scale: 0-255).
                String name = in.next();
                int r = in.nextInt();
                int g = in.nextInt();
                int b = in.nextInt();
                
                // Output bright shades of red, defined as follows: the intensity of red 
                // exceeds the intensity of green and blue by at least 128. 
                if (r - Math.max(g, b) >= 128) {
                    System.out.printf("%-10s %3d %3d %3d%n", name, r, g, b);
                }
            }
        }
    }
}