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

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

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

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

class E:
    def __init__(self, txt: str):
        self.z: B = None
        self.s: C = None
        self.x: E = None
        self.y: C = None
        self.t: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.z: B = None
        self.s: B = None
        self.w: E = None
        self.q: D = None
        self.y: B = None
        self.p: E = None
        self.txt = txt

g = A("g")
l = B("l")
e = C("e")
i = D("i")
h = E("h")
d = F("d")
c = E("c")
m = D("m")

g.z = m
g.q = e
l.q = h
l.s = i
l.o = i
l.t = e
l.w = c
e.w = i
i.w = g
i.s = e
i.p = h
i.u = c
i.r = d
h.z = l
h.s = e
h.y = e
h.x = c
h.t = d
d.z = l
d.s = l
d.y = l
d.w = h
d.q = i
d.p = c
c.z = l
c.s = e
c.y = e
c.x = h
c.t = d
m.w = g
m.s = e
m.p = c
m.u = h
m.r = d
assert c.z.q.y.txt == "
class A:
    def __init__(self, txt: str):
        self.z: D = None
        self.q: C = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.z: B = None
        self.s: C = None
        self.x: E = None
        self.y: C = None
        self.t: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.z: B = None
        self.s: B = None
        self.w: E = None
        self.q: D = None
        self.y: B = None
        self.p: E = None
        self.txt = txt

g = A("g")
l = B("l")
e = C("e")
i = D("i")
h = E("h")
d = F("d")
c = E("c")
m = D("m")

g.z = m
g.q = e
l.q = h
l.s = i
l.o = i
l.t = e
l.w = c
e.w = i
i.w = g
i.s = e
i.p = h
i.u = c
i.r = d
h.z = l
h.s = e
h.y = e
h.x = c
h.t = d
d.z = l
d.s = l
d.y = l
d.w = h
d.q = i
d.p = c
c.z = l
c.s = e
c.y = e
c.x = h
c.t = d
m.w = g
m.s = e
m.p = c
m.u = h
m.r = d
assert c.z.q.y.txt == "e"