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

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

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

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

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

i = A("i")
c = B("c")
l = C("l")
e = D("e")
m = E("m")
d = A("d")
k = C("k")
f = E("f")
a = B("a")
j = D("j")

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

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

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

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

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

i = A("i")
c = B("c")
l = C("l")
e = D("e")
m = E("m")
d = A("d")
k = C("k")
f = E("f")
a = B("a")
j = D("j")

i.w = c
i.z = a
c.q = d
c.z = d
c.v = a
c.s = f
l.r = k
l.v = i
e.t = m
m.x = e
m.o = f
d.w = a
d.z = a
k.r = l
k.v = i
f.x = e
f.o = m
a.q = d
a.v = c
a.z = i
a.s = m
j.t = f
assert c.v.s.x.t.txt == "m"