class A:
    def __init__(self, txt: str):
        self.w: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.p: E = None
        self.z: B = None
        self.t: F = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.r: F = None
        self.z: E = None
        self.y: E = None
        self.s: B = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.r: A = None
        self.s: D = None
        self.v: E = None
        self.o: E = None
        self.txt = txt

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

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

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

i.w = n
h.p = e
h.z = f
h.t = b
d.r = b
d.z = e
d.y = e
d.s = h
l.r = i
l.s = j
l.v = e
l.o = e
e.t = h
e.r = b
e.p = m
b.q = e
b.p = e
b.y = f
b.z = j
b.v = n
j.r = i
j.s = l
j.v = e
j.o = e
n.r = b
n.z = e
n.y = e
n.s = h
f.p = e
f.z = h
f.t = b
m.w = n
assert h.z.p.t.z.p.p.txt == "
class A:
    def __init__(self, txt: str):
        self.w: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.p: E = None
        self.z: B = None
        self.t: F = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.r: F = None
        self.z: E = None
        self.y: E = None
        self.s: B = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.r: A = None
        self.s: D = None
        self.v: E = None
        self.o: E = None
        self.txt = txt

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

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

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

i.w = n
h.p = e
h.z = f
h.t = b
d.r = b
d.z = e
d.y = e
d.s = h
l.r = i
l.s = j
l.v = e
l.o = e
e.t = h
e.r = b
e.p = m
b.q = e
b.p = e
b.y = f
b.z = j
b.v = n
j.r = i
j.s = l
j.v = e
j.o = e
n.r = b
n.z = e
n.y = e
n.s = h
f.p = e
f.z = h
f.t = b
m.w = n
assert h.z.p.t.z.p.p.txt == "m"