class A:
    def __init__(self, txt: str):
        self.w: F = None
        self.y: C = None
        self.p: D = None
        self.txt = txt

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

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

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

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

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

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

a = A("a")
e = B("e")
g = C("g")
h = D("h")
i = E("i")
m = F("m")
c = G("c")
n = G("n")
b = C("b")

a.w = m
a.y = g
a.p = h
e.r = b
g.w = h
g.y = a
g.z = i
g.v = e
h.x = g
i.p = e
i.z = m
i.w = m
i.x = a
i.o = g
i.t = h
m.o = g
m.r = e
m.p = e
m.w = a
m.s = h
m.x = c
m.z = i
c.y = e
c.r = e
c.v = n
c.t = g
c.w = h
n.y = e
n.r = e
n.v = c
n.t = g
n.w = h
b.w = h
b.y = a
b.z = i
b.v = e
assert m.z.t.x.v.r.txt == "
class A:
    def __init__(self, txt: str):
        self.w: F = None
        self.y: C = None
        self.p: D = None
        self.txt = txt

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

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

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

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

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

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

a = A("a")
e = B("e")
g = C("g")
h = D("h")
i = E("i")
m = F("m")
c = G("c")
n = G("n")
b = C("b")

a.w = m
a.y = g
a.p = h
e.r = b
g.w = h
g.y = a
g.z = i
g.v = e
h.x = g
i.p = e
i.z = m
i.w = m
i.x = a
i.o = g
i.t = h
m.o = g
m.r = e
m.p = e
m.w = a
m.s = h
m.x = c
m.z = i
c.y = e
c.r = e
c.v = n
c.t = g
c.w = h
n.y = e
n.r = e
n.v = c
n.t = g
n.w = h
b.w = h
b.y = a
b.z = i
b.v = e
assert m.z.t.x.v.r.txt == "b"