class A:
    def __init__(self, txt: str):
        self.x: B = None
        self.r: D = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.p: E = None
        self.y: A = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.q: E = None
        self.z: C = None
        self.r: G = None
        self.w: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.o: C = None
        self.v: A = None
        self.q: D = None
        self.s: C = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.r: A = None
        self.p: A = None
        self.z: F = None
        self.u: A = None
        self.q: E = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.p: E = None
        self.y: A = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.q: E = None
        self.z: C = None
        self.r: G = None
        self.w: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.o: C = None
        self.v: A = None
        self.q: D = None
        self.s: C = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.r: A = None
        self.p: A = None
        self.z: F = None
        self.u: A = None
        self.q: E = None
        self.txt = txt

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

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