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

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

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

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

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

d.v = e
h.s = i
h.q = n
h.y = d
c.z = n
c.v = m
e.y = m
e.z = h
e.t = c
i.s = h
i.q = c
i.y = d
b.v = m
m.y = e
m.z = h
m.t = l
n.z = c
n.v = m
l.z = c
l.v = e
g.v = e
assert n.v.t.z.z.v.txt == "
class A:
    def __init__(self, txt: str):
        self.v: D = None
        self.txt = txt

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

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

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

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

d.v = e
h.s = i
h.q = n
h.y = d
c.z = n
c.v = m
e.y = m
e.z = h
e.t = c
i.s = h
i.q = c
i.y = d
b.v = m
m.y = e
m.z = h
m.t = l
n.z = c
n.v = m
l.z = c
l.v = e
g.v = e
assert n.v.t.z.z.v.txt == "m"