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

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

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

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

k = A("k")
e = B("e")
n = C("n")
m = D("m")
i = B("i")
h = C("h")
j = B("j")

k.z = n
k.x = h
k.o = h
e.p = n
n.y = j
m.s = i
m.q = j
m.u = h
m.o = n
i.p = n
h.y = i
j.p = h
assert h.y.p.y.txt == "
class A:
    def __init__(self, txt: str):
        self.z: C = None
        self.x: C = None
        self.o: C = None
        self.txt = txt

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

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

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

k = A("k")
e = B("e")
n = C("n")
m = D("m")
i = B("i")
h = C("h")
j = B("j")

k.z = n
k.x = h
k.o = h
e.p = n
n.y = j
m.s = i
m.q = j
m.u = h
m.o = n
i.p = n
h.y = i
j.p = h
assert h.y.p.y.txt == "j"