class A:
    def __init__(self, txt: str):
        self.v: F = None
        self.u: D = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.v: B = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.q: E = None
        self.w: A = None
        self.t: D = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.z: C = None
        self.s: D = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.v: B = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.q: E = None
        self.w: A = None
        self.t: D = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.z: C = None
        self.s: D = None
        self.txt = txt

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

f.v = g
f.u = k
c.v = a
b.q = d
b.s = d
b.y = d
b.z = f
k.q = d
k.w = f
k.t = n
d.r = f
d.p = f
d.x = c
d.q = c
d.z = a
g.z = h
g.s = k
h.q = d
h.s = d
h.y = d
h.z = f
n.q = d
n.w = f
n.t = k
a.v = c
m.z = b
m.s = k
assert m.z.z.v.s.w.v.s.t.txt == "n"