package laba7;

class ClassA {
    public int a;

    public ClassA(int a) {
        this.a = a;
    }

    public void set(int a) {
        this.a = a;
    }

    @Override
    public String toString() {
        return "ClassA: a=" + a;
    }
}

class ClassB extends ClassA {
    public char b;

    public ClassB(int a, char b) {
        super(a);
        this.b = b;
    }

    public void set(int a, char b) {
        this.a = a;
        this.b = b;
    }

    @Override
    public String toString() {
        return "ClassB: a=" + a + ", b=" + b;
    }
}

class ClassC extends ClassB {
    public String c;

    public ClassC(int a, char b, String c) {
        super(a, b);
        this.c = c;
    }

    public void set(int a, char b, String c) {
        this.a = a;
        this.b = b;
        this.c = c;
    }

    @Override
    public String toString() {
        return "ClassC: a=" + a + ", b=" + b + ", c=" + c;
    }
}

public class example3 {
    public static void main(String[] args) {
        ClassC obj = new ClassC(5, 'X', "Text");
        System.out.println(obj);
    }
}