class A:
    def __init__(self, txt: str):
        self.x: C = None
        self.p: C = None
        self.t: C = None
        self.z: F = None
        self.y: H = None
        self.o: F = None
        self.s: H = None
        self.q: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.x: H = None
        self.y: F = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.r: F = None
        self.w: A = None
        self.q: F = None
        self.y: G = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.q: E = None
        self.v: G = None
        self.r: B = None
        self.t: A = None
        self.u: C = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.q: C = None
        self.s: F = None
        self.r: A = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.r: A = None
        self.s: A = None
        self.txt = txt

b = A("b")
f = B("f")
e = C("e")
k = D("k")
a = E("a")
c = F("c")
j = G("j")
m = H("m")

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

class B:
    def __init__(self, txt: str):
        self.x: H = None
        self.y: F = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.r: F = None
        self.w: A = None
        self.q: F = None
        self.y: G = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.q: E = None
        self.v: G = None
        self.r: B = None
        self.t: A = None
        self.u: C = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.q: C = None
        self.s: F = None
        self.r: A = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.r: A = None
        self.s: A = None
        self.txt = txt

b = A("b")
f = B("f")
e = C("e")
k = D("k")
a = E("a")
c = F("c")
j = G("j")
m = H("m")

b.x = e
b.p = e
b.t = e
b.q = e
b.z = c
b.o = c
b.y = m
b.s = m
f.x = m
f.y = c
e.r = c
e.q = c
e.w = b
e.y = j
k.q = a
k.v = j
k.r = f
k.t = b
k.u = e
a.s = m
a.o = f
c.p = m
c.z = k
j.q = e
j.s = c
j.r = b
m.r = b
m.s = b
assert e.q.z.q.s.r.o.txt == "c"