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

class B:
    def __init__(self, txt: str):
        self.t: F = None
        self.z: B = None
        self.y: E = None
        self.o: B = None
        self.u: F = None
        self.w: F = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.u: B = None
        self.t: B = None
        self.w: D = None
        self.x: D = None
        self.txt = txt

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

a = A("a")
d = B("d")
b = C("b")
c = D("c")
n = E("n")
h = F("h")
l = E("l")
i = C("i")
m = F("m")
f = B("f")

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

class B:
    def __init__(self, txt: str):
        self.t: F = None
        self.z: B = None
        self.y: E = None
        self.o: B = None
        self.u: F = None
        self.w: F = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.u: B = None
        self.t: B = None
        self.w: D = None
        self.x: D = None
        self.txt = txt

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

a = A("a")
d = B("d")
b = C("b")
c = D("c")
n = E("n")
h = F("h")
l = E("l")
i = C("i")
m = F("m")
f = B("f")

a.x = c
a.q = c
a.y = c
d.t = m
d.z = f
d.o = f
d.y = n
d.u = h
d.w = h
b.r = l
b.s = n
b.u = h
b.z = h
b.w = h
b.v = i
c.z = a
c.v = a
c.u = f
c.y = n
n.u = d
n.t = d
n.w = c
n.x = c
h.r = i
l.u = f
l.t = f
l.w = c
l.x = c
i.r = l
i.s = n
i.u = m
i.z = m
i.w = m
i.v = b
m.r = b
f.t = m
f.u = m
f.w = m
f.z = d
f.o = d
f.y = l
assert a.x.y.w.z.txt == "a"