/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package codejam.common;

import java.util.ArrayList;
import java.util.List;

/**
 *
 * @author Lance Chen
 */
public class CodeHelper {

    private static String FILE_ROOT = "D:/workspace/googlecodejam/meta";

    public static List<List<String>> loadInputsExcludes(String fileName) {
        List<List<String>> result = new ArrayList<List<String>>();
        List<String> lines = FileUtil.readLines(FILE_ROOT + fileName);
        int index = 0;
        for (String line : lines) {
            if (index == 0) {
                index++;
                continue;
            }
            if (index % 2 == 1) {
                index++;
                continue;
            }
            List<String> dataList = new ArrayList<String>();
            String[] dataArray = line.split("\\s+");
            for (String data : dataArray) {
                if (data.trim().length() > 0) {
                    dataList.add(data);
                }
            }
            result.add(dataList);
            index++;
        }
        return result;
    }

    public static List<List<String>> loadInputs(String fileName) {
        List<List<String>> result = new ArrayList<List<String>>();
        List<String> lines = FileUtil.readLines(FILE_ROOT + fileName);
        for (String line : lines) {
            List<String> dataList = new ArrayList<String>();
            String[] dataArray = line.split("\\s+");
            for (String data : dataArray) {
                if (data.trim().length() > 0) {
                    dataList.add(data);
                }
            }
            result.add(dataList);
        }
        return result;
    }

    public static List<String> loadInputLines(String fileName) {
        return FileUtil.readLines(FILE_ROOT + fileName);
    }

    public static void writeOutputs(String fileName, List<String> lines) {
        FileUtil.writeLines(FILE_ROOT + fileName, lines);
    }
}

import java.util.*;
public class triple
{
	public HashSet<Integer> theset=new HashSet<Integer>();
	public int first;
	public int second;
	public int third;
	public int total;
	public int p;
	public int state;//1 is norm, 2 is surp, 3 is noway
	public triple(int f, int s, int t)
	{
		theset.add(f);
		theset.add(s);
		theset.add(t);
		first=f;
		second=s;
		third=t;
		total=f+s+t;
		if((Math.abs(f-s)>2)||(Math.abs(f-t)>2)||(Math.abs(s-t)>2))
		{
			state=3;
		}
		else if(((Math.abs(f-s)<=1)&&(Math.abs(f-t)<=1)&&(Math.abs(s-t)<=1)))
		{
			state=1;
		}
		else
		{
			state=2;
		}
		p=Math.max(f, Math.max(s,t));
	}
	public String toString()
	{
		return first+"+"+second+"+"+third+"="+total+", max="+p+", state="+state;
		
	}
}
