class A:
    def __init__(self, txt: str):
        self.z: B = None
        self.q: D = None
        self.p: G = None
        self.x: B = None
        self.o: D = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.q: E = None
        self.z: H = None
        self.u: A = None
        self.s: A = None
        self.w: H = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.v: B = None
        self.p: H = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.y: F = None
        self.x: C = None
        self.t: C = None
        self.o: B = None
        self.u: C = None
        self.z: A = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.r: A = None
        self.u: H = None
        self.p: C = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.y: G = None
        self.o: E = None
        self.u: A = None
        self.r: E = None
        self.txt = txt

c = A("c")
g = B("g")
k = C("k")
m = D("m")
f = E("f")
b = F("b")
i = G("i")
l = H("l")

c.z = g
c.x = g
c.q = m
c.o = m
c.p = i
g.q = f
g.z = l
g.w = l
g.u = c
g.s = c
k.v = g
k.p = l
m.y = i
f.y = b
f.x = k
f.t = k
f.u = k
f.o = g
f.z = c
b.t = k
b.w = k
i.r = c
i.u = l
i.p = k
l.y = i
l.o = f
l.r = f
l.u = c
assert g.s.p.p.p.txt == "
class A:
    def __init__(self, txt: str):
        self.z: B = None
        self.q: D = None
        self.p: G = None
        self.x: B = None
        self.o: D = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.q: E = None
        self.z: H = None
        self.u: A = None
        self.s: A = None
        self.w: H = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.v: B = None
        self.p: H = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.y: F = None
        self.x: C = None
        self.t: C = None
        self.o: B = None
        self.u: C = None
        self.z: A = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.r: A = None
        self.u: H = None
        self.p: C = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.y: G = None
        self.o: E = None
        self.u: A = None
        self.r: E = None
        self.txt = txt

c = A("c")
g = B("g")
k = C("k")
m = D("m")
f = E("f")
b = F("b")
i = G("i")
l = H("l")

c.z = g
c.x = g
c.q = m
c.o = m
c.p = i
g.q = f
g.z = l
g.w = l
g.u = c
g.s = c
k.v = g
k.p = l
m.y = i
f.y = b
f.x = k
f.t = k
f.u = k
f.o = g
f.z = c
b.t = k
b.w = k
i.r = c
i.u = l
i.p = k
l.y = i
l.o = f
l.r = f
l.u = c
assert g.s.p.p.p.txt == "l"