class A:
    def __init__(self, txt: str):
        self.o: B = None
        self.p: C = None
        self.y: E = None
        self.s: E = 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.o: A = None
        self.p: D = None
        self.s: C = None
        self.z: A = None
        self.u: E = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.x: A = None
        self.r: A = None
        self.y: D = None
        self.p: C = None
        self.t: D = None
        self.txt = txt

e = A("e")
a = B("a")
j = C("j")
h = D("h")
l = E("l")
n = C("n")

e.o = a
e.p = j
e.y = l
e.s = l
a.o = j
j.o = e
j.z = e
j.p = h
j.s = n
j.u = l
h.x = j
l.x = e
l.r = e
l.y = h
l.t = h
l.p = n
n.o = e
n.z = e
n.p = h
n.s = j
n.u = l
assert l.r.o.o.z.txt == "
class A:
    def __init__(self, txt: str):
        self.o: B = None
        self.p: C = None
        self.y: E = None
        self.s: E = 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.o: A = None
        self.p: D = None
        self.s: C = None
        self.z: A = None
        self.u: E = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.x: A = None
        self.r: A = None
        self.y: D = None
        self.p: C = None
        self.t: D = None
        self.txt = txt

e = A("e")
a = B("a")
j = C("j")
h = D("h")
l = E("l")
n = C("n")

e.o = a
e.p = j
e.y = l
e.s = l
a.o = j
j.o = e
j.z = e
j.p = h
j.s = n
j.u = l
h.x = j
l.x = e
l.r = e
l.y = h
l.t = h
l.p = n
n.o = e
n.z = e
n.p = h
n.s = j
n.u = l
assert l.r.o.o.z.txt == "e"