import java.util.ArrayList; 

public class Sequence {
  private ArrayList<Integer> values;   
  public Sequence() {
    this.values = new ArrayList<Integer>();
  }  
  public Sequence(int[] values) {
    this(); 
    for (int v : values)
      this.values.add( v ); 
  }
  public Sequence (Sequence sequence) {
    this.values = new ArrayList<Integer>( sequence.values ); // clone  
  }
  public void add(int n) {
    this.values.add(n);
  }
  public String toString() {
    return this.values.toString();
  }
  public static void main(String[] args) {    
    Sequence a = new Sequence( new int[] { 4, 5, 2, 3, 1, 7, 6 } ); 
    System.out.println( a ); 
    Sequence b = new Sequence( a ); 
    System.out.println( b ); 
    b.add(3); 
    System.out.println( a ); 
    System.out.println( b );     
  }
}