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

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

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

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

class E:
    def __init__(self, txt: str):
        self.t: A = None
        self.r: E = None
        self.u: F = None
        self.p: A = None
        self.txt = txt

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

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

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

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

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

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

class E:
    def __init__(self, txt: str):
        self.t: A = None
        self.r: E = None
        self.u: F = None
        self.p: A = None
        self.txt = txt

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

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

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