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

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

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

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

l = A("l")
c = B("c")
a = C("a")
h = D("h")
d = B("d")
f = B("f")
g = A("g")
b = C("b")
n = D("n")
i = A("i")

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

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

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

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

l = A("l")
c = B("c")
a = C("a")
h = D("h")
d = B("d")
f = B("f")
g = A("g")
b = C("b")
n = D("n")
i = A("i")

l.t = n
l.y = b
l.z = b
c.s = d
c.u = n
c.y = b
a.o = n
h.w = n
h.r = g
h.y = f
d.s = f
d.u = h
d.y = b
f.s = c
f.u = n
f.y = a
g.t = h
g.y = a
g.z = b
b.o = h
n.w = h
n.r = i
n.y = c
i.t = h
i.y = a
i.z = a
assert l.z.o.r.t.y.u.txt == "n"