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

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

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

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

b = A("b")
n = B("n")
j = C("j")
e = D("e")
i = B("i")
f = C("f")
h = B("h")
d = A("d")

b.o = e
b.r = j
b.p = n
n.s = j
j.t = i
j.y = i
j.z = f
e.y = h
e.w = f
e.u = j
i.s = j
f.t = n
f.z = j
f.y = i
h.s = j
d.o = e
d.r = f
d.p = i
assert j.z.y.s.y.txt == "
class A:
    def __init__(self, txt: str):
        self.o: D = None
        self.r: C = None
        self.p: B = None
        self.txt = txt

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

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

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

b = A("b")
n = B("n")
j = C("j")
e = D("e")
i = B("i")
f = C("f")
h = B("h")
d = A("d")

b.o = e
b.r = j
b.p = n
n.s = j
j.t = i
j.y = i
j.z = f
e.y = h
e.w = f
e.u = j
i.s = j
f.t = n
f.z = j
f.y = i
h.s = j
d.o = e
d.r = f
d.p = i
assert j.z.y.s.y.txt == "i"