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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.r: C = None
        self.u: E = None
        self.txt = txt

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

l = A("l")
d = B("d")
a = C("a")
k = D("k")
m = E("m")
g = F("g")
c = G("c")

l.z = a
l.u = d
l.s = m
d.p = k
d.w = l
d.s = c
d.q = a
a.q = l
k.q = c
k.o = g
m.q = k
m.o = k
m.x = k
m.v = k
m.r = l
g.r = a
g.u = m
c.s = a
c.o = l
c.v = k
c.u = k
c.q = d
assert a.q.s.x.q.s.q.z.txt == "
class A:
    def __init__(self, txt: str):
        self.z: C = None
        self.u: B = None
        self.s: E = None
        self.txt = txt

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.r: C = None
        self.u: E = None
        self.txt = txt

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

l = A("l")
d = B("d")
a = C("a")
k = D("k")
m = E("m")
g = F("g")
c = G("c")

l.z = a
l.u = d
l.s = m
d.p = k
d.w = l
d.s = c
d.q = a
a.q = l
k.q = c
k.o = g
m.q = k
m.o = k
m.x = k
m.v = k
m.r = l
g.r = a
g.u = m
c.s = a
c.o = l
c.v = k
c.u = k
c.q = d
assert a.q.s.x.q.s.q.z.txt == "a"