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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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