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

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

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

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

j = A("j")
a = B("a")
d = C("d")
i = D("i")
m = B("m")
e = B("e")
l = A("l")
f = D("f")
k = D("k")
c = C("c")

j.o = d
j.s = c
j.z = i
a.y = c
d.z = e
d.u = c
d.p = c
i.s = k
i.y = d
i.t = a
i.x = c
m.y = d
e.y = d
l.o = d
l.s = c
l.z = i
f.s = k
f.y = d
f.t = e
f.x = c
k.s = i
k.y = d
k.t = m
k.x = c
c.z = a
c.u = d
c.p = d
assert i.y.p.z.y.p.p.z.txt == "
class A:
    def __init__(self, txt: str):
        self.o: C = None
        self.s: C = None
        self.z: D = None
        self.txt = txt

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

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

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

j = A("j")
a = B("a")
d = C("d")
i = D("i")
m = B("m")
e = B("e")
l = A("l")
f = D("f")
k = D("k")
c = C("c")

j.o = d
j.s = c
j.z = i
a.y = c
d.z = e
d.u = c
d.p = c
i.s = k
i.y = d
i.t = a
i.x = c
m.y = d
e.y = d
l.o = d
l.s = c
l.z = i
f.s = k
f.y = d
f.t = e
f.x = c
k.s = i
k.y = d
k.t = m
k.x = c
c.z = a
c.u = d
c.p = d
assert i.y.p.z.y.p.p.z.txt == "a"