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

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

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

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

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

n.o = i
n.z = m
n.v = m
n.w = f
i.r = f
i.z = f
i.q = m
m.o = b
m.p = f
m.v = h
m.x = i
h.y = m
c.o = f
c.z = m
c.v = m
c.w = i
f.r = i
f.z = i
f.q = m
b.o = i
b.w = i
b.z = m
b.v = m
a.o = i
a.w = i
a.z = m
a.v = m
e.o = i
e.z = m
e.v = m
e.w = f
l.o = f
l.w = f
l.z = m
l.v = m
assert n.o.q.v.y.x.r.q.txt == "
class A:
    def __init__(self, txt: str):
        self.o: B = None
        self.z: C = None
        self.w: B = None
        self.v: C = None
        self.txt = txt

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

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

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

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

n.o = i
n.z = m
n.v = m
n.w = f
i.r = f
i.z = f
i.q = m
m.o = b
m.p = f
m.v = h
m.x = i
h.y = m
c.o = f
c.z = m
c.v = m
c.w = i
f.r = i
f.z = i
f.q = m
b.o = i
b.w = i
b.z = m
b.v = m
a.o = i
a.w = i
a.z = m
a.v = m
e.o = i
e.z = m
e.v = m
e.w = f
l.o = f
l.w = f
l.z = m
l.v = m
assert n.o.q.v.y.x.r.q.txt == "m"