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

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

class C:
    def __init__(self, txt: str):
        self.y: E = None
        self.r: E = None
        self.t: C = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.q: E = None
        self.z: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.r: A = None
        self.s: E = None
        self.z: D = None
        self.p: D = None
        self.o: C = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.y: E = None
        self.r: E = None
        self.t: C = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.q: E = None
        self.z: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.r: A = None
        self.s: E = None
        self.z: D = None
        self.p: D = None
        self.o: C = None
        self.txt = txt

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

n.v = f
h.s = a
h.o = a
h.q = m
h.t = f
f.y = b
f.r = b
f.t = g
e.q = l
e.z = l
b.r = m
b.s = l
b.z = e
b.p = e
b.o = g
m.v = f
a.s = h
a.o = h
a.q = n
a.t = g
i.q = l
i.z = b
l.r = m
l.s = b
l.z = i
l.p = i
l.o = f
g.y = b
g.r = b
g.t = f
assert f.t.y.z.q.z.q.o.t.y.txt == "b"