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

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

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

class D:
    def __init__(self, txt: str):
        self.v: B = None
        self.o: A = None
        self.txt = txt

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

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

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

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.v: B = None
        self.o: A = None
        self.txt = txt

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

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

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

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

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