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

class B:
    def __init__(self, txt: str):
        self.w: G = None
        self.q: C = None
        self.t: E = None
        self.r: E = None
        self.z: G = None
        self.o: E = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.p: B = None
        self.x: E = None
        self.u: F = None
        self.v: F = None
        self.s: F = None
        self.w: B = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.p: A = None
        self.q: D = None
        self.x: B = None
        self.t: F = None
        self.w: B = None
        self.v: D = None
        self.y: D = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.r: G = None
        self.t: A = None
        self.txt = txt

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

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

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

class B:
    def __init__(self, txt: str):
        self.w: G = None
        self.q: C = None
        self.t: E = None
        self.r: E = None
        self.z: G = None
        self.o: E = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.p: B = None
        self.x: E = None
        self.u: F = None
        self.v: F = None
        self.s: F = None
        self.w: B = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.p: A = None
        self.q: D = None
        self.x: B = None
        self.t: F = None
        self.w: B = None
        self.v: D = None
        self.y: D = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.r: G = None
        self.t: A = None
        self.txt = txt

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

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

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