class A:
    def __init__(self, txt: str):
        self.z: E = None
        self.y: C = None
        self.w: G = None
        self.v: E = None
        self.t: C = None
        self.q: C = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.q: A = None
        self.p: B = None
        self.v: E = None
        self.x: E = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.q: B = None
        self.r: E = None
        self.p: A = None
        self.o: C = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.s: F = None
        self.p: F = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.q: A = None
        self.p: B = None
        self.v: E = None
        self.x: E = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.q: B = None
        self.r: E = None
        self.p: A = None
        self.o: C = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.s: F = None
        self.p: F = None
        self.txt = txt

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

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