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

class B:
    def __init__(self, txt: str):
        self.y: F = None
        self.v: F = None
        self.t: D = None
        self.txt = txt

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

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

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

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

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

class H:
    def __init__(self, txt: str):
        self.p: F = None
        self.u: F = None
        self.w: B = None
        self.v: A = None
        self.y: B = None
        self.s: E = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.y: F = None
        self.v: F = None
        self.t: D = None
        self.txt = txt

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

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

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

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

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

class H:
    def __init__(self, txt: str):
        self.p: F = None
        self.u: F = None
        self.w: B = None
        self.v: A = None
        self.y: B = None
        self.s: E = None
        self.txt = txt

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

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