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

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

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

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

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

d = A("d")
h = B("h")
e = C("e")
b = D("b")
l = E("l")
a = D("a")
j = C("j")
c = B("c")
k = D("k")
n = E("n")

d.o = j
h.p = n
h.s = j
h.q = l
e.z = d
e.y = a
e.x = j
b.s = e
l.w = e
l.o = k
l.u = n
l.s = b
l.y = b
a.s = j
j.z = d
j.y = b
j.x = e
c.p = l
c.q = l
c.s = e
k.s = e
n.w = e
n.o = a
n.y = a
n.u = l
n.s = b
assert b.s.x.z.o.txt == "
class A:
    def __init__(self, txt: str):
        self.o: C = None
        self.txt = txt

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

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

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

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

d = A("d")
h = B("h")
e = C("e")
b = D("b")
l = E("l")
a = D("a")
j = C("j")
c = B("c")
k = D("k")
n = E("n")

d.o = j
h.p = n
h.s = j
h.q = l
e.z = d
e.y = a
e.x = j
b.s = e
l.w = e
l.o = k
l.u = n
l.s = b
l.y = b
a.s = j
j.z = d
j.y = b
j.x = e
c.p = l
c.q = l
c.s = e
k.s = e
n.w = e
n.o = a
n.y = a
n.u = l
n.s = b
assert b.s.x.z.o.txt == "j"