import java.io.*;

class Transaction {
	private String item;
	private double amount;

	public Transaction(String item, double amount) {
		this.item = item;
		this.amount = amount;
	}
 	public Transaction(DataInputStream in) throws IOException {
 		item = in.readUTF();
		amount = in.readDouble();
 	}

	public void write(DataOutputStream out) throws IOException {
		out.writeUTF(item);
		out.writeDouble(amount);
	}

	public double getAmount() { return amount; }

	public String toString() {
		return amount + " " + item; 
	}	
}
