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

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

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

c = A("c")
k = B("k")
m = C("m")
b = D("b")
j = E("j")
n = D("n")
i = B("i")
h = E("h")

c.z = j
c.p = i
c.s = k
k.o = c
m.u = k
b.x = m
j.p = c
j.v = m
j.u = n
n.x = m
i.o = c
h.p = c
h.v = m
h.u = b
assert h.p.s.o.s.txt == "
class A:
    def __init__(self, txt: str):
        self.z: E = None
        self.p: B = None
        self.s: B = None
        self.txt = txt

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

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

c = A("c")
k = B("k")
m = C("m")
b = D("b")
j = E("j")
n = D("n")
i = B("i")
h = E("h")

c.z = j
c.p = i
c.s = k
k.o = c
m.u = k
b.x = m
j.p = c
j.v = m
j.u = n
n.x = m
i.o = c
h.p = c
h.v = m
h.u = b
assert h.p.s.o.s.txt == "k"