class Fibonacci {
    /** Print out the Fibonacci sequence for values < 50 */
    public static void main(String[] args) {

	int[] fibs = new int[25];	// assume there aren't more then 25
	int next = 0;			// next element of array to fill

	int lo = 1;
	int hi = 1;

	fibs[next++] = lo;
	while (hi < 50) {
	    fibs[next++] = hi;
	    hi = lo + hi;	// new hi
	    lo = hi - lo;	/* new lo is (sum - old lo)
				   i.e., the old hi */
	}

	for (int i = 0; i < next; i++)
	    System.out.println((i + 1) + ": " + fibs[i]);
    }
}
