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

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

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

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

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

i.r = c
i.z = e
m.o = c
m.v = j
a.z = d
a.y = d
a.v = c
h.u = a
d.z = a
d.y = a
d.v = m
b.r = c
b.z = j
e.u = a
j.u = a
c.o = m
c.v = j
f.r = c
f.z = j
assert e.u.v.v.u.v.v.u.txt == "
class A:
    def __init__(self, txt: str):
        self.r: B = None
        self.z: D = None
        self.txt = txt

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

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

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

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

i.r = c
i.z = e
m.o = c
m.v = j
a.z = d
a.y = d
a.v = c
h.u = a
d.z = a
d.y = a
d.v = m
b.r = c
b.z = j
e.u = a
j.u = a
c.o = m
c.v = j
f.r = c
f.z = j
assert e.u.v.v.u.v.v.u.txt == "a"