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

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

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

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

class E:
    def __init__(self, txt: str):
        self.r: C = None
        self.w: A = None
        self.q: C = None
        self.txt = txt

k = A("k")
e = B("e")
d = C("d")
f = D("f")
l = E("l")
c = B("c")

k.s = e
k.v = f
k.y = f
e.z = l
e.v = l
e.p = k
e.o = f
e.x = c
d.z = k
f.y = d
f.t = d
f.p = d
f.z = l
f.r = e
l.r = d
l.q = d
l.w = k
c.z = l
c.v = l
c.p = k
c.o = f
c.x = e
assert d.z.s.o.r.x.z.txt == "
class A:
    def __init__(self, txt: str):
        self.s: B = None
        self.v: D = None
        self.y: D = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.r: C = None
        self.w: A = None
        self.q: C = None
        self.txt = txt

k = A("k")
e = B("e")
d = C("d")
f = D("f")
l = E("l")
c = B("c")

k.s = e
k.v = f
k.y = f
e.z = l
e.v = l
e.p = k
e.o = f
e.x = c
d.z = k
f.y = d
f.t = d
f.p = d
f.z = l
f.r = e
l.r = d
l.q = d
l.w = k
c.z = l
c.v = l
c.p = k
c.o = f
c.x = e
assert d.z.s.o.r.x.z.txt == "l"