class A:
    def __init__(self, txt: str):
        self.r: B = None
        self.y: C = None
        self.s: C = None
        self.v: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.q: A = None
        self.o: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.r: B = None
        self.t: A = None
        self.q: D = None
        self.s: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.y: C = None
        self.txt = txt

i = A("i")
e = B("e")
h = C("h")
c = D("c")
l = B("l")

i.r = e
i.y = h
i.s = h
i.v = h
e.q = i
e.o = c
h.r = e
h.t = i
h.q = c
h.s = c
c.y = h
l.q = i
l.o = c
assert c.y.s.y.t.txt == "
class A:
    def __init__(self, txt: str):
        self.r: B = None
        self.y: C = None
        self.s: C = None
        self.v: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.q: A = None
        self.o: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.r: B = None
        self.t: A = None
        self.q: D = None
        self.s: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.y: C = None
        self.txt = txt

i = A("i")
e = B("e")
h = C("h")
c = D("c")
l = B("l")

i.r = e
i.y = h
i.s = h
i.v = h
e.q = i
e.o = c
h.r = e
h.t = i
h.q = c
h.s = c
c.y = h
l.q = i
l.o = c
assert c.y.s.y.t.txt == "i"