import java.io.*;

class Libro {
  String titolo;
  String autore;
  double prezzo;
  int copie;

  String getTitolo() {
    return this.titolo;
  }

  String getAutore() {
    return this.autore;
  }

  double getPrezzo() {
    return this.prezzo;
  }

  int getCopie() {
    return this.copie;
  }

  void setTitolo(String titolo) {
    this.titolo=titolo;
  }

  void setAutore(String autore) {
    this.autore=autore;
  }

  void setPrezzo(double prezzo) {
    if(prezzo<=0)
      throw new RuntimeException("Prezzo negativo");
    this.prezzo=prezzo;
  }

  void setCopie(int copie) {
    if(copie<0)
      throw new RuntimeException("Numero di copie negativo");
    this.copie=copie;
  }

  Libro(BufferedReader b) throws IOException {
    String s;

    s=b.readLine();
    if(s==null)
      throw new RuntimeException("Errore di lettura");
    this.titolo=s;


    s=b.readLine();
    if(s==null)
      throw new RuntimeException("Errore di lettura");
    this.autore=s;


    s=b.readLine();
    if(s==null)
      throw new RuntimeException("Errore di lettura");
    this.prezzo=Double.parseDouble(s);


    s=b.readLine();
    if(s==null)
      throw new RuntimeException("Errore di lettura");
    this.copie=Integer.parseInt(s);
  }

  public String toString() {
    return "["+this.titolo+", "+this.autore+", "+this.prezzo
           +", "+this.copie+"]";
  }
}



