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

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

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

class D:
    def __init__(self, txt: str):
        self.o: D = None
        self.r: B = None
        self.txt = txt

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

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.o: D = None
        self.r: B = None
        self.txt = txt

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

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

n.z = k
n.x = k
n.v = k
n.y = d
n.w = c
i.z = n
i.s = h
i.w = h
i.o = f
d.x = i
d.w = a
c.o = a
c.r = f
k.y = d
k.q = d
k.t = h
k.o = f
k.v = c
f.z = n
f.s = k
f.w = h
f.o = i
a.o = c
a.r = f
h.y = d
h.q = d
h.t = k
h.o = f
h.v = c
assert c.o.r.s.o.o.z.w.r.txt == "f"