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

class B:
    def __init__(self, txt: str):
        self.r: C = None
        self.z: C = None
        self.u: C = None
        self.o: E = None
        self.w: E = None
        self.txt = txt

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

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.r: C = None
        self.z: C = None
        self.u: C = None
        self.o: E = None
        self.w: E = None
        self.txt = txt

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

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

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

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

i.z = e
i.v = l
e.r = k
e.z = k
e.u = k
e.o = f
e.w = m
k.p = i
l.r = e
l.t = e
l.x = e
l.u = k
l.q = f
f.z = l
m.z = l
assert f.z.u.p.z.o.txt == "f"