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

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

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

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

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

e = A("e")
f = B("f")
h = C("h")
k = D("k")
a = E("a")
b = A("b")
m = E("m")
n = D("n")

e.q = n
e.o = n
e.w = f
f.s = n
h.v = b
k.z = n
a.s = k
a.z = e
a.v = b
a.p = m
b.q = k
b.o = k
b.w = f
m.s = n
m.z = e
m.v = b
m.p = a
n.z = k
assert k.z.z.z.txt == "
class A:
    def __init__(self, txt: str):
        self.q: D = None
        self.o: D = None
        self.w: B = None
        self.txt = txt

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

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

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

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

e = A("e")
f = B("f")
h = C("h")
k = D("k")
a = E("a")
b = A("b")
m = E("m")
n = D("n")

e.q = n
e.o = n
e.w = f
f.s = n
h.v = b
k.z = n
a.s = k
a.z = e
a.v = b
a.p = m
b.q = k
b.o = k
b.w = f
m.s = n
m.z = e
m.v = b
m.p = a
n.z = k
assert k.z.z.z.txt == "n"