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

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

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

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

class E:
    def __init__(self, txt: str):
        self.r: D = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.o: E = None
        self.t: B = None
        self.q: G = None
        self.p: C = None
        self.x: D = None
        self.y: D = None
        self.s: D = None
        self.txt = txt

g = A("g")
c = B("c")
a = C("a")
b = D("b")
i = E("i")
k = F("k")
d = G("d")
m = D("m")
n = G("n")
f = D("f")

g.o = a
g.z = m
g.u = i
g.q = i
c.t = k
a.u = c
a.r = c
b.q = k
i.r = m
k.r = a
k.w = a
k.s = g
d.o = i
d.t = c
d.q = n
d.p = a
d.x = m
d.y = m
d.s = f
m.q = k
n.o = i
n.t = c
n.q = d
n.p = a
n.x = b
n.y = m
n.s = m
f.q = k
assert m.q.s.z.q.txt == "
class A:
    def __init__(self, txt: str):
        self.o: C = None
        self.z: D = None
        self.u: E = None
        self.q: E = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.r: D = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.o: E = None
        self.t: B = None
        self.q: G = None
        self.p: C = None
        self.x: D = None
        self.y: D = None
        self.s: D = None
        self.txt = txt

g = A("g")
c = B("c")
a = C("a")
b = D("b")
i = E("i")
k = F("k")
d = G("d")
m = D("m")
n = G("n")
f = D("f")

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