class A:
    def __init__(self, txt: str):
        self.y: E = None
        self.w: D = None
        self.z: B = None
        self.p: D = None
        self.u: B = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.p: H = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.q: H = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.z: F = None
        self.x: B = None
        self.r: A = None
        self.o: G = None
        self.t: H = None
        self.y: A = None
        self.w: D = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.o: B = None
        self.q: G = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.q: F = None
        self.s: H = None
        self.y: B = None
        self.txt = txt

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.p: H = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.q: H = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.z: F = None
        self.x: B = None
        self.r: A = None
        self.o: G = None
        self.t: H = None
        self.y: A = None
        self.w: D = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.o: B = None
        self.q: G = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.q: F = None
        self.s: H = None
        self.y: B = None
        self.txt = txt

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

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

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