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

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

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

class D:
    def __init__(self, txt: str):
        self.y: F = None
        self.t: F = None
        self.w: B = None
        self.r: C = None
        self.p: B = None
        self.s: C = None
        self.txt = txt

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

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

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.y: F = None
        self.t: F = None
        self.w: B = None
        self.r: C = None
        self.p: B = None
        self.s: C = None
        self.txt = txt

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

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

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

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