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

class B:
    def __init__(self, txt: str):
        self.x: F = None
        self.o: A = None
        self.p: A = None
        self.s: G = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.z: A = None
        self.r: C = None
        self.t: F = None
        self.o: H = None
        self.q: G = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.q: C = None
        self.z: H = None
        self.s: E = None
        self.v: B = None
        self.y: A = None
        self.txt = txt

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

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

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

class B:
    def __init__(self, txt: str):
        self.x: F = None
        self.o: A = None
        self.p: A = None
        self.s: G = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.z: A = None
        self.r: C = None
        self.t: F = None
        self.o: H = None
        self.q: G = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.q: C = None
        self.z: H = None
        self.s: E = None
        self.v: B = None
        self.y: A = None
        self.txt = txt

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

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

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