using System;

class IgralnayaKost 
{
    readonly Random r;
    public event Action<int> MaxRolled;

    public IgralnayaKost()
    {
        r = new Random();
    }

    public int random()
    {
        int res = r.Next(6) + 1;
        if (res == 6) MaxRolled?.Invoke(res);
        return res;
    }
}

