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

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

class C:
    def __init__(self, txt: str):
        self.w: C = None
        self.z: D = None
        self.x: B = None
        self.o: G = None
        self.p: A = None
        self.y: D = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.x: C = None
        self.z: C = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.w: A = None
        self.z: G = None
        self.o: C = None
        self.s: D = None
        self.r: C = None
        self.t: D = None
        self.p: F = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.w: C = None
        self.z: D = None
        self.x: B = None
        self.o: G = None
        self.p: A = None
        self.y: D = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.x: C = None
        self.z: C = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.w: A = None
        self.z: G = None
        self.o: C = None
        self.s: D = None
        self.r: C = None
        self.t: D = None
        self.p: F = None
        self.txt = txt

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

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