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

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

class C:
    def __init__(self, txt: str):
        self.q: C = None
        self.v: C = None
        self.o: A = None
        self.txt = txt

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.q: C = None
        self.v: C = None
        self.o: A = None
        self.txt = txt

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

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

b.z = h
b.u = l
b.v = l
e.r = b
e.v = b
e.y = i
m.q = j
m.v = j
m.o = b
i.t = d
i.v = m
i.y = h
i.z = j
a.z = h
a.u = l
a.v = l
l.z = d
l.u = b
l.v = b
d.t = h
d.v = m
d.y = i
d.z = j
j.q = m
j.v = m
j.o = l
k.r = b
k.v = b
k.y = d
h.t = d
h.v = m
h.z = m
h.y = i
assert d.v.q.o.z.t.z.txt == "m"