class A:
    def __init__(self, txt: str):
        self.x: B = None
        self.s: E = None
        self.q: H = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.t: D = None
        self.v: F = None
        self.x: G = None
        self.u: H = None
        self.s: B = None
        self.y: H = None
        self.txt = txt

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

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

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

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

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.t: D = None
        self.v: F = None
        self.x: G = None
        self.u: H = None
        self.s: B = None
        self.y: H = None
        self.txt = txt

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

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

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

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

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

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

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