import java.util.Arrays;

public class Permutation
{
  private int n;
  private int thePerm[];

  public Permutation(int size)
  {
    this.n = size;
    this.thePerm = new int[this.n];
    for(int i = 0; i < n; i++)
    {
      this.thePerm[i] = i;
    }
  }

  public Permutation(Permutation v)
  {
    this.n = v.getN();
    this.thePerm = new int[this.n];
    for(int i = 0; i < this.n; i++)
    {
      this.thePerm[i] = v.getVal(i);
    }
  }

  public int getN()
  {
    return this.n;
  }

  public int getVal(int i)
  {
    return this.thePerm[i];
  }

  public void setVal(int where, int what)
  {
    this.thePerm[where] = what;
  }

  public String toString()
  {
    return Arrays.toString(this.thePerm);
  }

  public static void main(String args[])
  {
    Permutation p1 = new Permutation(5);
    Permutation p2 = new Permutation(p1);
    System.out.println("p1:" + p1);
    System.out.println("p2:" + p2);
  }
}

