class A:
    def __init__(self, txt: str):
        self.o: E = None
        self.z: D = None
        self.s: C = None
        self.y: C = None
        self.txt = txt

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

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

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

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

a = A("a")
g = B("g")
e = C("e")
j = D("j")
l = E("l")
k = A("k")

a.o = l
a.z = j
a.s = e
a.y = e
g.o = e
e.r = j
e.p = j
j.r = l
j.q = l
j.t = g
j.z = e
j.o = k
l.t = a
l.w = k
l.q = e
k.o = l
k.z = j
k.s = e
k.y = e
assert a.z.t.o.txt == "
class A:
    def __init__(self, txt: str):
        self.o: E = None
        self.z: D = None
        self.s: C = None
        self.y: C = None
        self.txt = txt

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

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

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

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

a = A("a")
g = B("g")
e = C("e")
j = D("j")
l = E("l")
k = A("k")

a.o = l
a.z = j
a.s = e
a.y = e
g.o = e
e.r = j
e.p = j
j.r = l
j.q = l
j.t = g
j.z = e
j.o = k
l.t = a
l.w = k
l.q = e
k.o = l
k.z = j
k.s = e
k.y = e
assert a.z.t.o.txt == "e"