using System;
using System.Collections.Generic;
using System.Security.Cryptography;
using System.Text;

class User
{
    public string Username { get; }
    public string PasswordHash { get; }
    public string Email { get; }

    public User(string username, string password, string email)
    {
        Username = username;
        PasswordHash = HashPassword(password);
        Email = email;
    }

    protected string HashPassword(string password)
    {
        using (SHA256 sha256 = SHA256.Create())
        {
            byte[] hashBytes = sha256.ComputeHash(Encoding.UTF8.GetBytes(password));
            return BitConverter.ToString(hashBytes).Replace("-", "").ToLower();
        }
    }

    public virtual void DisplayInfo()
    {
        Console.WriteLine($"Username: {Username}, Email: {Email}");
    }
}

class Admin : User
{
    public List<string> Privileges { get; } = new List<string>();

    public Admin(string username, string password, string email) 
        : base(username, password, email) {}

    public void GrantPrivilege(string privilege)
    {
        Privileges.Add(privilege);
    }

    public override void DisplayInfo()
    {
        base.DisplayInfo();
        Console.WriteLine($"Privileges: {string.Join(", ", Privileges)}");
    }
}

class Guest : User
{
    public DateTime ExpirationDate { get; }

    public Guest(string username, string password, string email, DateTime expirationDate) 
        : base(username, password, email)
    {
        ExpirationDate = expirationDate;
    }

    public override void DisplayInfo()
    {
        base.DisplayInfo();
        Console.WriteLine($"Expires: {ExpirationDate.ToShortDateString()}");
    }
}