class A:
    def __init__(self, txt: str):
        self.u: E = None
        self.x: E = None
        self.y: E = None
        self.s: D = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.z: A = None
        self.q: A = None
        self.y: D = None
        self.txt = txt

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

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

c.u = k
c.x = k
c.y = k
c.s = m
e.u = f
l.s = g
l.v = m
f.z = c
f.q = c
f.y = m
k.o = e
k.v = m
k.x = f
k.w = f
g.u = f
m.z = c
m.q = c
m.y = f
assert m.z.x.v.y.y.txt == "
class A:
    def __init__(self, txt: str):
        self.u: E = None
        self.x: E = None
        self.y: E = None
        self.s: D = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.z: A = None
        self.q: A = None
        self.y: D = None
        self.txt = txt

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

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

c.u = k
c.x = k
c.y = k
c.s = m
e.u = f
l.s = g
l.v = m
f.z = c
f.q = c
f.y = m
k.o = e
k.v = m
k.x = f
k.w = f
g.u = f
m.z = c
m.q = c
m.y = f
assert m.z.x.v.y.y.txt == "m"