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

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

class C:
    def __init__(self, txt: str):
        self.z: A = None
        self.s: E = None
        self.t: A = None
        self.o: F = None
        self.x: A = None
        self.txt = txt

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

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

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.z: A = None
        self.s: E = None
        self.t: A = None
        self.o: F = None
        self.x: A = None
        self.txt = txt

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

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

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

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

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