class A:
    def __init__(self, txt: str):
        self.o: H = None
        self.y: H = None
        self.r: H = None
        self.txt = txt

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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