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

class B:
    def __init__(self, txt: str):
        self.p: C = None
        self.s: D = None
        self.v: E = None
        self.x: F = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.r: B = None
        self.w: G = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.r: E = None
        self.w: D = None
        self.v: D = None
        self.o: D = None
        self.q: B = None
        self.y: G = None
        self.s: G = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.t: A = None
        self.z: A = None
        self.o: E = None
        self.p: A = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.p: C = None
        self.s: D = None
        self.v: E = None
        self.x: F = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.r: B = None
        self.w: G = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.r: E = None
        self.w: D = None
        self.v: D = None
        self.o: D = None
        self.q: B = None
        self.y: G = None
        self.s: G = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.t: A = None
        self.z: A = None
        self.o: E = None
        self.p: A = None
        self.txt = txt

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

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