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

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

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

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

class E:
    def __init__(self, txt: str):
        self.z: B = None
        self.txt = txt

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

e.r = a
e.x = a
e.s = l
b.y = e
a.x = b
m.u = b
m.s = l
m.v = j
j.z = b
l.u = b
l.s = m
l.v = j
assert e.s.u.y.txt == "
class A:
    def __init__(self, txt: str):
        self.r: C = None
        self.x: C = None
        self.s: D = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.z: B = None
        self.txt = txt

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

e.r = a
e.x = a
e.s = l
b.y = e
a.x = b
m.u = b
m.s = l
m.v = j
j.z = b
l.u = b
l.s = m
l.v = j
assert e.s.u.y.txt == "e"