class A:
    def __init__(self, txt: str):
        self.z: D = None
        self.w: G = None
        self.p: D = None
        self.r: D = None
        self.t: G = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.r: E = None
        self.y: D = None
        self.w: D = None
        self.q: A = None
        self.x: A = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.q: H = None
        self.y: H = None
        self.u: D = None
        self.o: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.u: H = None
        self.o: A = None
        self.y: F = None
        self.s: H = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.o: B = None
        self.r: D = None
        self.p: B = None
        self.z: D = None
        self.s: H = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.w: F = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.v: D = None
        self.z: G = None
        self.x: F = None
        self.u: E = None
        self.txt = txt

a = A("a")
d = B("d")
k = C("k")
e = D("e")
h = E("h")
l = F("l")
i = G("i")
n = H("n")

a.z = e
a.p = e
a.r = e
a.w = i
a.t = i
d.r = h
d.y = e
d.w = e
d.q = a
d.x = a
k.q = n
k.y = n
k.u = e
k.o = l
e.u = n
e.s = n
e.o = a
e.y = l
h.o = d
h.p = d
h.r = e
h.z = e
h.s = n
l.v = a
i.w = l
n.v = e
n.z = i
n.x = l
n.u = h
assert a.w.w.v.r.o.t.w.txt == "
class A:
    def __init__(self, txt: str):
        self.z: D = None
        self.w: G = None
        self.p: D = None
        self.r: D = None
        self.t: G = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.r: E = None
        self.y: D = None
        self.w: D = None
        self.q: A = None
        self.x: A = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.q: H = None
        self.y: H = None
        self.u: D = None
        self.o: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.u: H = None
        self.o: A = None
        self.y: F = None
        self.s: H = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.o: B = None
        self.r: D = None
        self.p: B = None
        self.z: D = None
        self.s: H = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.w: F = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.v: D = None
        self.z: G = None
        self.x: F = None
        self.u: E = None
        self.txt = txt

a = A("a")
d = B("d")
k = C("k")
e = D("e")
h = E("h")
l = F("l")
i = G("i")
n = H("n")

a.z = e
a.p = e
a.r = e
a.w = i
a.t = i
d.r = h
d.y = e
d.w = e
d.q = a
d.x = a
k.q = n
k.y = n
k.u = e
k.o = l
e.u = n
e.s = n
e.o = a
e.y = l
h.o = d
h.p = d
h.r = e
h.z = e
h.s = n
l.v = a
i.w = l
n.v = e
n.z = i
n.x = l
n.u = h
assert a.w.w.v.r.o.t.w.txt == "l"