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

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

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

class D:
    def __init__(self, txt: str):
        self.u: A = None
        self.w: A = None
        self.o: D = None
        self.y: D = None
        self.s: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.x: C = None
        self.p: F = None
        self.q: C = None
        self.txt = txt

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

m = A("m")
b = B("b")
n = C("n")
d = D("d")
g = E("g")
j = F("j")
h = F("h")
i = D("i")
f = C("f")

m.z = b
m.y = d
m.o = g
b.z = g
b.s = m
b.p = m
b.y = f
b.x = j
b.u = n
n.z = h
n.w = i
n.t = m
n.y = m
n.q = m
d.u = m
d.w = m
d.o = i
d.y = i
d.s = n
g.x = n
g.q = n
g.p = h
j.y = n
j.x = n
j.t = i
j.o = h
h.y = f
h.x = n
h.t = i
h.o = j
i.u = m
i.w = m
i.o = d
i.y = d
i.s = f
f.z = j
f.w = d
f.t = m
f.y = m
f.q = m
assert n.w.u.z.u.q.y.txt == "
class A:
    def __init__(self, txt: str):
        self.z: B = None
        self.y: D = None
        self.o: E = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.u: A = None
        self.w: A = None
        self.o: D = None
        self.y: D = None
        self.s: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.x: C = None
        self.p: F = None
        self.q: C = None
        self.txt = txt

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

m = A("m")
b = B("b")
n = C("n")
d = D("d")
g = E("g")
j = F("j")
h = F("h")
i = D("i")
f = C("f")

m.z = b
m.y = d
m.o = g
b.z = g
b.s = m
b.p = m
b.y = f
b.x = j
b.u = n
n.z = h
n.w = i
n.t = m
n.y = m
n.q = m
d.u = m
d.w = m
d.o = i
d.y = i
d.s = n
g.x = n
g.q = n
g.p = h
j.y = n
j.x = n
j.t = i
j.o = h
h.y = f
h.x = n
h.t = i
h.o = j
i.u = m
i.w = m
i.o = d
i.y = d
i.s = f
f.z = j
f.w = d
f.t = m
f.y = m
f.q = m
assert n.w.u.z.u.q.y.txt == "d"