import java.lang.Iterable;
import java.util.Iterator;
import java.util.NoSuchElementException;


class Triple implements Iterable<String> {
	private String first;
	private String second;
	private String third;

	Triple(String f, String s, String t) {
		first = f;
		second = s;
		third = t;
	}

	public Iterator<String> iterator() {
		
		return new TripleIterator();
	}

	class TripleIterator implements Iterator<String> {
		private int numReturned = 0;

		public boolean hasNext() {
			/*if (numReturned == 3) {
				return false;
			}
			else {
				return true;
			}*/

			return (numReturned < 3);	
		}

		public String next() {
			if(numReturned == 0) {
				numReturned++;
				return first;
			}
			else if (numReturned == 1) {
				numReturned++;
				return second;
			} 
			else if (numReturned == 2) {
				numReturned++;
				return third;
			}
			else {
				throw new NoSuchElementException();
			}
		}
	}

}



