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

class B:
    def __init__(self, txt: str):
        self.y: C = None
        self.z: D = None
        self.u: C = None
        self.s: E = None
        self.w: G = None
        self.x: A = None
        self.q: G = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.o: G = None
        self.r: B = None
        self.y: B = None
        self.z: A = None
        self.u: A = None
        self.p: B = None
        self.v: D = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.x: F = None
        self.s: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.p: E = None
        self.o: B = None
        self.y: C = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.z: B = None
        self.t: C = None
        self.s: G = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.y: C = None
        self.z: D = None
        self.u: C = None
        self.s: E = None
        self.w: G = None
        self.x: A = None
        self.q: G = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.o: G = None
        self.r: B = None
        self.y: B = None
        self.z: A = None
        self.u: A = None
        self.p: B = None
        self.v: D = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.x: F = None
        self.s: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.p: E = None
        self.o: B = None
        self.y: C = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.z: B = None
        self.t: C = None
        self.s: G = None
        self.txt = txt

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

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