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

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

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

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

h = A("h")
e = B("e")
c = C("c")
d = D("d")
l = A("l")
m = C("m")
j = D("j")
i = A("i")
g = A("g")

h.z = c
h.v = c
h.o = l
h.y = j
e.v = m
e.z = m
e.r = c
e.x = i
c.p = e
c.v = e
d.v = e
d.t = e
d.q = j
d.z = c
l.z = m
l.v = c
l.o = g
l.y = d
m.p = e
m.v = e
j.v = e
j.t = e
j.q = d
j.z = c
i.z = c
i.v = m
i.o = l
i.y = j
g.z = c
g.v = c
g.o = h
g.y = j
assert h.y.t.r.p.x.v.txt == "
class A:
    def __init__(self, txt: str):
        self.z: C = None
        self.v: C = None
        self.o: A = None
        self.y: D = None
        self.txt = txt

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

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

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

h = A("h")
e = B("e")
c = C("c")
d = D("d")
l = A("l")
m = C("m")
j = D("j")
i = A("i")
g = A("g")

h.z = c
h.v = c
h.o = l
h.y = j
e.v = m
e.z = m
e.r = c
e.x = i
c.p = e
c.v = e
d.v = e
d.t = e
d.q = j
d.z = c
l.z = m
l.v = c
l.o = g
l.y = d
m.p = e
m.v = e
j.v = e
j.t = e
j.q = d
j.z = c
i.z = c
i.v = m
i.o = l
i.y = j
g.z = c
g.v = c
g.o = h
g.y = j
assert h.y.t.r.p.x.v.txt == "m"