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

class B:
    def __init__(self, txt: str):
        self.w: D = None
        self.t: E = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.s: B = None
        self.v: A = None
        self.txt = txt

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

n.r = a
n.q = c
n.o = c
c.w = h
c.t = f
l.w = g
l.q = g
l.t = h
l.o = m
l.z = c
h.z = c
f.s = c
f.v = g
g.r = m
g.q = c
g.o = c
m.w = n
m.t = h
m.o = a
m.q = g
m.z = c
a.w = n
a.q = n
a.t = h
a.o = l
a.z = c
assert h.z.t.s.t.s.t.v.txt == "
class A:
    def __init__(self, txt: str):
        self.r: C = None
        self.q: B = None
        self.o: B = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.w: D = None
        self.t: E = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.s: B = None
        self.v: A = None
        self.txt = txt

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

n.r = a
n.q = c
n.o = c
c.w = h
c.t = f
l.w = g
l.q = g
l.t = h
l.o = m
l.z = c
h.z = c
f.s = c
f.v = g
g.r = m
g.q = c
g.o = c
m.w = n
m.t = h
m.o = a
m.q = g
m.z = c
a.w = n
a.q = n
a.t = h
a.o = l
a.z = c
assert h.z.t.s.t.s.t.v.txt == "g"