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

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

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

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

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

k = A("k")
i = B("i")
e = C("e")
a = D("a")
m = E("m")
f = C("f")
g = A("g")
h = A("h")

k.o = g
k.q = g
k.x = m
i.z = f
e.o = a
a.u = g
a.z = g
m.p = a
m.w = e
m.v = i
f.o = a
g.o = h
g.x = m
g.q = k
h.o = k
h.x = m
h.q = g
assert g.q.q.q.x.txt == "
class A:
    def __init__(self, txt: str):
        self.o: A = None
        self.x: E = None
        self.q: A = None
        self.txt = txt

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

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

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

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

k = A("k")
i = B("i")
e = C("e")
a = D("a")
m = E("m")
f = C("f")
g = A("g")
h = A("h")

k.o = g
k.q = g
k.x = m
i.z = f
e.o = a
a.u = g
a.z = g
m.p = a
m.w = e
m.v = i
f.o = a
g.o = h
g.x = m
g.q = k
h.o = k
h.x = m
h.q = g
assert g.q.q.q.x.txt == "m"