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

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

class C:
    def __init__(self, txt: str):
        self.y: A = None
        self.w: B = None
        self.p: G = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.x: C = None
        self.z: C = None
        self.o: G = None
        self.v: B = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.x: E = None
        self.r: A = None
        self.v: A = None
        self.z: C = None
        self.txt = txt

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

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.y: A = None
        self.w: B = None
        self.p: G = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.x: C = None
        self.z: C = None
        self.o: G = None
        self.v: B = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.x: E = None
        self.r: A = None
        self.v: A = None
        self.z: C = None
        self.txt = txt

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

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

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

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