/* package whatever; // don't place package name! */

import java.util.*;
import java.lang.*;
import java.io.*;

class Point
{
	public int X;
	public int Y;
}

class PointArray
{
	private Point[] array;
	public PointArray(int size) throws Exception
	{
		if(size <= 0) throw new Exception("Array size less equal zero.");
		this.array = new Point[size];
	}
	
	public void SetCoordinates(int index, int x, int y) throws Exception
	{
		if(index < this.array.length && index > 0)
		{
			this.array[index].X = x;
			this.array[index].Y = y;
		}
		else throw new Exception("Array index out or range.");
	}
	
	public Point GetCoordinates(int index) throws Exception
	{
		if(index < this.array.length && index > 0)
		{
			return this.array[index];
		}
		else throw new Exception("Array index out or range.");
	}
}

class Ideone
{
	public static void main (String[] args) throws java.lang.Exception
	{
		try
		{
			PointArray pa = new PointArray(1);
			pa.SetCoordinates(1,1,1);
			Point point = pa.GetCoordinates(2);
		}
		catch(Exception ex)
		{
			System.out.println(ex);
		}
	}
}