using System; 

abstract class Item : IComparable
{
    protected long invNumber;
    protected bool taken;

    public Item(long invNumber, bool taken)
    {
        this.invNumber = invNumber;
        this.taken = taken;
    }

    public Item()
    {
        this.taken = true;
    }

    public bool IsAvailable()
    {
        return taken;
    }

    public long GetInvNumber()
    {
        return invNumber;
    }

    private void Take()
    {
        taken = false;
    }

    public void TakeItem()
    {
        if (this.IsAvailable())
            this.Take();
    }


    abstract public void Return();

    public virtual void Show()
    {
        Console.WriteLine("Состояние единицы хранения:\n Инвентарный номер: {0}\n Наличие: {1}", invNumber, taken);
    }

    int IComparable.CompareTo(object obj)
    {
        Item it = (Item)obj;
        if (this.invNumber == it.invNumber) return 0;
        else if (this.invNumber > it.invNumber) return 1;
        else return -1;
    }
}
