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

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

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

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

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

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

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

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

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

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

f.z = i
f.s = e
f.y = d
e.r = i
h.z = e
h.p = m
h.x = d
i.w = e
i.y = h
b.w = e
b.y = h
m.w = e
m.y = h
d.z = e
d.p = b
d.x = h
k.z = i
k.s = e
k.y = h
j.w = e
j.y = d
assert e.r.y.p.txt == "m"