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

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

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

n = A("n")
l = B("l")
k = C("k")
b = C("b")
c = C("c")
h = A("h")
m = C("m")
d = A("d")
i = A("i")

n.v = i
n.t = h
l.v = c
k.z = h
k.o = h
k.u = m
b.z = i
b.u = m
b.o = d
c.z = d
c.u = m
c.o = i
h.v = n
h.t = i
m.z = d
m.u = b
m.o = i
d.v = h
d.t = h
i.v = n
i.t = h
assert d.v.v.v.txt == "
class A:
    def __init__(self, txt: str):
        self.v: A = None
        self.t: A = None
        self.txt = txt

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

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

n = A("n")
l = B("l")
k = C("k")
b = C("b")
c = C("c")
h = A("h")
m = C("m")
d = A("d")
i = A("i")

n.v = i
n.t = h
l.v = c
k.z = h
k.o = h
k.u = m
b.z = i
b.u = m
b.o = d
c.z = d
c.u = m
c.o = i
h.v = n
h.t = i
m.z = d
m.u = b
m.o = i
d.v = h
d.t = h
i.v = n
i.t = h
assert d.v.v.v.txt == "i"