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

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

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

class D:
    def __init__(self, txt: str):
        self.r: B = None
        self.u: C = None
        self.p: E = None
        self.txt = txt

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

c = A("c")
f = B("f")
l = C("l")
a = D("a")
e = E("e")
j = E("j")

c.s = j
c.t = j
c.x = l
c.v = l
f.x = a
l.z = f
a.r = f
a.u = l
a.p = e
e.s = a
e.t = l
e.q = f
j.s = a
j.t = l
j.q = f
assert c.v.z.x.txt == "
class A:
    def __init__(self, txt: str):
        self.s: E = None
        self.x: C = None
        self.t: E = None
        self.v: C = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.r: B = None
        self.u: C = None
        self.p: E = None
        self.txt = txt

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

c = A("c")
f = B("f")
l = C("l")
a = D("a")
e = E("e")
j = E("j")

c.s = j
c.t = j
c.x = l
c.v = l
f.x = a
l.z = f
a.r = f
a.u = l
a.p = e
e.s = a
e.t = l
e.q = f
j.s = a
j.t = l
j.q = f
assert c.v.z.x.txt == "a"