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

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

class C:
    def __init__(self, txt: str):
        self.q: A = None
        self.t: B = None
        self.x: G = None
        self.z: G = None
        self.txt = txt

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

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

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

class G:
    def __init__(self, txt: str):
        self.y: E = None
        self.p: E = None
        self.r: G = None
        self.z: C = None
        self.v: B = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.q: A = None
        self.t: B = None
        self.x: G = None
        self.z: G = None
        self.txt = txt

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

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

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

class G:
    def __init__(self, txt: str):
        self.y: E = None
        self.p: E = None
        self.r: G = None
        self.z: C = None
        self.v: B = None
        self.txt = txt

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

g.q = d
g.x = f
g.v = c
g.r = b
g.u = m
e.w = k
e.v = b
f.q = g
f.t = e
f.x = b
f.z = a
d.x = e
h.r = f
h.t = a
h.v = b
h.u = e
h.w = g
k.v = d
k.p = d
b.y = h
b.p = m
b.r = a
b.z = f
b.v = e
a.y = m
a.p = m
a.r = b
a.z = f
a.v = e
m.r = f
m.t = a
m.v = a
m.u = e
m.w = g
c.r = f
c.t = b
c.v = a
c.u = e
c.w = g
assert e.v.r.z.x.txt == "b"