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

class B:
    def __init__(self, txt: str):
        self.r: G = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.z: G = None
        self.w: A = None
        self.u: H = None
        self.q: D = None
        self.v: E = None
        self.r: B = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.q: G = None
        self.v: H = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.y: B = None
        self.o: F = None
        self.t: A = None
        self.z: D = None
        self.u: A = None
        self.p: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.q: E = None
        self.p: E = None
        self.x: A = None
        self.s: C = None
        self.z: H = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.t: E = None
        self.q: H = None
        self.z: D = None
        self.s: E = None
        self.w: F = None
        self.o: H = None
        self.x: F = None
        self.v: C = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.q: G = None
        self.txt = txt

n = A("n")
d = B("d")
m = C("m")
h = D("h")
e = E("e")
a = F("a")
g = G("g")
l = H("l")

n.r = g
n.o = g
d.r = g
m.z = g
m.w = n
m.u = l
m.q = h
m.v = e
m.r = d
h.q = g
h.v = l
e.y = d
e.o = a
e.p = a
e.t = n
e.u = n
e.z = h
a.q = e
a.p = e
a.x = n
a.s = m
a.z = l
g.t = e
g.s = e
g.q = l
g.o = l
g.z = h
g.w = a
g.x = a
g.v = m
l.q = g
assert e.o.z.q.z.q.s.txt == "
class A:
    def __init__(self, txt: str):
        self.r: G = None
        self.o: G = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.r: G = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.z: G = None
        self.w: A = None
        self.u: H = None
        self.q: D = None
        self.v: E = None
        self.r: B = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.q: G = None
        self.v: H = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.y: B = None
        self.o: F = None
        self.t: A = None
        self.z: D = None
        self.u: A = None
        self.p: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.q: E = None
        self.p: E = None
        self.x: A = None
        self.s: C = None
        self.z: H = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.t: E = None
        self.q: H = None
        self.z: D = None
        self.s: E = None
        self.w: F = None
        self.o: H = None
        self.x: F = None
        self.v: C = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.q: G = None
        self.txt = txt

n = A("n")
d = B("d")
m = C("m")
h = D("h")
e = E("e")
a = F("a")
g = G("g")
l = H("l")

n.r = g
n.o = g
d.r = g
m.z = g
m.w = n
m.u = l
m.q = h
m.v = e
m.r = d
h.q = g
h.v = l
e.y = d
e.o = a
e.p = a
e.t = n
e.u = n
e.z = h
a.q = e
a.p = e
a.x = n
a.s = m
a.z = l
g.t = e
g.s = e
g.q = l
g.o = l
g.z = h
g.w = a
g.x = a
g.v = m
l.q = g
assert e.o.z.q.z.q.s.txt == "e"