class A:
    def __init__(self, txt: str):
        self.t: B = None
        self.w: B = None
        self.z: A = None
        self.txt = txt

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

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

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

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

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

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

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

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

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

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