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

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

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

class D:
    def __init__(self, txt: str):
        self.w: C = None
        self.y: C = None
        self.q: E = None
        self.txt = txt

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

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

e.o = a
e.x = i
e.q = i
e.t = m
k.s = h
m.q = a
m.s = e
m.z = k
i.w = m
i.y = m
i.q = a
a.v = e
a.x = e
a.s = m
a.w = m
a.z = k
h.s = k
assert a.x.q.q.x.txt == "
class A:
    def __init__(self, txt: str):
        self.o: E = None
        self.x: D = None
        self.q: D = None
        self.t: C = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.w: C = None
        self.y: C = None
        self.q: E = None
        self.txt = txt

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

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

e.o = a
e.x = i
e.q = i
e.t = m
k.s = h
m.q = a
m.s = e
m.z = k
i.w = m
i.y = m
i.q = a
a.v = e
a.x = e
a.s = m
a.w = m
a.z = k
h.s = k
assert a.x.q.q.x.txt == "e"