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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.z: D = None
        self.r: E = None
        self.v: B = None
        self.o: E = None
        self.x: E = None
        self.txt = txt

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

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

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

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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.z: D = None
        self.r: E = None
        self.v: B = None
        self.o: E = None
        self.x: E = None
        self.txt = txt

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

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

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

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