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

class B:
    def __init__(self, txt: str):
        self.q: A = None
        self.v: E = None
        self.p: D = None
        self.z: E = None
        self.y: A = None
        self.txt = txt

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

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.q: A = None
        self.v: E = None
        self.p: D = None
        self.z: E = None
        self.y: A = None
        self.txt = txt

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

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

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

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

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