class A:
    def __init__(self, txt: str):
        self.q: B = None
        self.x: F = None
        self.v: C = None
        self.u: B = None
        self.z: F = None
        self.txt = txt

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

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

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

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

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

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

class H:
    def __init__(self, txt: str):
        self.o: B = None
        self.q: A = None
        self.s: A = None
        self.p: F = None
        self.u: A = None
        self.txt = txt

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

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

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

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

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

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

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

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

class H:
    def __init__(self, txt: str):
        self.o: B = None
        self.q: A = None
        self.s: A = None
        self.p: F = None
        self.u: A = None
        self.txt = txt

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

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