class A:
    def __init__(self, txt: str):
        self.v: B = None
        self.w: B = None
        self.q: B = None
        self.o: D = 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.x: C = None
        self.v: D = None
        self.o: E = None
        self.p: C = None
        self.u: D = None
        self.q: C = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.t: C = None
        self.p: A = None
        self.s: D = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.q: E = None
        self.v: A = None
        self.x: A = None
        self.o: F = None
        self.t: B = None
        self.z: A = None
        self.txt = txt

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

m.v = a
m.w = a
m.q = a
m.o = h
a.p = h
d.x = l
d.p = l
d.q = l
d.v = n
d.u = n
d.o = i
n.w = i
n.p = i
n.q = f
n.x = a
n.z = a
i.t = d
i.p = m
i.s = h
f.q = i
f.v = m
f.x = m
f.z = m
f.o = e
f.t = a
h.w = i
h.p = i
h.q = e
h.x = a
h.z = a
l.x = d
l.p = d
l.q = d
l.v = h
l.o = i
l.u = n
e.q = i
e.v = m
e.x = m
e.z = m
e.o = f
e.t = a
assert a.p.z.p.z.p.q.q.txt == "
class A:
    def __init__(self, txt: str):
        self.v: B = None
        self.w: B = None
        self.q: B = None
        self.o: D = 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.x: C = None
        self.v: D = None
        self.o: E = None
        self.p: C = None
        self.u: D = None
        self.q: C = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.t: C = None
        self.p: A = None
        self.s: D = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.q: E = None
        self.v: A = None
        self.x: A = None
        self.o: F = None
        self.t: B = None
        self.z: A = None
        self.txt = txt

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

m.v = a
m.w = a
m.q = a
m.o = h
a.p = h
d.x = l
d.p = l
d.q = l
d.v = n
d.u = n
d.o = i
n.w = i
n.p = i
n.q = f
n.x = a
n.z = a
i.t = d
i.p = m
i.s = h
f.q = i
f.v = m
f.x = m
f.z = m
f.o = e
f.t = a
h.w = i
h.p = i
h.q = e
h.x = a
h.z = a
l.x = d
l.p = d
l.q = d
l.v = h
l.o = i
l.u = n
e.q = i
e.v = m
e.x = m
e.z = m
e.o = f
e.t = a
assert a.p.z.p.z.p.q.q.txt == "i"