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

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

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

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

b = A("b")
l = B("l")
e = C("e")
n = D("n")
a = B("a")
j = C("j")

b.w = n
b.y = j
b.z = j
l.t = a
l.x = b
l.s = j
e.o = a
e.p = a
n.x = l
n.o = b
a.t = l
a.x = b
a.s = e
j.o = l
j.p = a
assert j.o.s.p.s.p.x.txt == "
class A:
    def __init__(self, txt: str):
        self.w: D = None
        self.y: C = None
        self.z: C = None
        self.txt = txt

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

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

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

b = A("b")
l = B("l")
e = C("e")
n = D("n")
a = B("a")
j = C("j")

b.w = n
b.y = j
b.z = j
l.t = a
l.x = b
l.s = j
e.o = a
e.p = a
n.x = l
n.o = b
a.t = l
a.x = b
a.s = e
j.o = l
j.p = a
assert j.o.s.p.s.p.x.txt == "b"