class A:
    def __init__(self, txt: str):
        self.r: E = None
        self.p: C = None
        self.u: D = None
        self.o: H = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.q: H = None
        self.t: E = None
        self.z: G = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.o: H = None
        self.r: A = None
        self.v: B = None
        self.q: G = None
        self.u: G = None
        self.z: B = None
        self.t: C = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.w: B = None
        self.r: H = None
        self.o: H = None
        self.z: D = None
        self.v: H = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.z: H = None
        self.r: F = None
        self.o: C = None
        self.y: A = None
        self.v: D = None
        self.p: A = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.v: E = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.q: H = None
        self.t: E = None
        self.z: G = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.o: H = None
        self.r: A = None
        self.v: B = None
        self.q: G = None
        self.u: G = None
        self.z: B = None
        self.t: C = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.w: B = None
        self.r: H = None
        self.o: H = None
        self.z: D = None
        self.v: H = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.z: H = None
        self.r: F = None
        self.o: C = None
        self.y: A = None
        self.v: D = None
        self.p: A = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.v: E = None
        self.txt = txt

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

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