class A:
    def __init__(self, txt: str):
        self.z: B = None
        self.v: C = None
        self.p: D = None
        self.x: A = None
        self.t: D = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.q: B = None
        self.o: B = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.s: A = None
        self.q: B = None
        self.z: A = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.r: F = None
        self.v: B = None
        self.x: F = None
        self.t: D = None
        self.o: D = None
        self.s: C = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.q: B = None
        self.o: B = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.s: A = None
        self.q: B = None
        self.z: A = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.r: F = None
        self.v: B = None
        self.x: F = None
        self.t: D = None
        self.o: D = None
        self.s: C = None
        self.txt = txt

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

f.z = e
f.v = h
f.p = g
f.t = g
f.x = c
e.x = h
e.p = h
e.q = d
e.u = d
e.z = n
e.o = b
h.q = e
h.o = e
g.v = c
g.t = h
g.s = f
n.s = c
n.q = e
n.z = d
b.r = i
b.x = i
b.v = e
b.t = g
b.o = g
b.s = h
i.r = b
i.x = b
i.v = e
i.t = g
i.o = g
i.s = h
d.z = e
d.v = m
d.p = g
d.t = g
d.x = f
m.q = e
m.o = e
c.z = e
c.v = h
c.p = g
c.t = g
c.x = d
assert m.o.z.q.x.o.p.q.z.txt == "n"