class A:
    def __init__(self, txt: str):
        self.r: B = None
        self.y: H = None
        self.q: D = None
        self.u: D = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.u: B = None
        self.s: A = None
        self.y: F = None
        self.w: E = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.s: C = None
        self.w: B = None
        self.q: E = None
        self.r: C = None
        self.t: H = None
        self.x: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.x: C = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.p: A = None
        self.txt = txt

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.u: B = None
        self.s: A = None
        self.y: F = None
        self.w: E = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.s: C = None
        self.w: B = None
        self.q: E = None
        self.r: C = None
        self.t: H = None
        self.x: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.x: C = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.p: A = None
        self.txt = txt

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

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

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