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

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

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

class D:
    def __init__(self, txt: str):
        self.s: A = None
        self.txt = txt

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.s: A = None
        self.txt = txt

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

l.y = h
l.o = i
h.s = c
h.u = l
h.y = l
h.r = i
i.p = c
i.w = c
i.s = h
i.t = l
c.s = l
assert h.u.y.y.txt == "l"