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

class B:
    def __init__(self, txt: str):
        self.o: F = None
        self.w: A = None
        self.x: G = None
        self.r: G = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.s: C = None
        self.o: D = None
        self.r: A = None
        self.x: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.z: A = None
        self.r: G = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.r: F = None
        self.w: C = None
        self.v: A = None
        self.txt = txt

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

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

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

class B:
    def __init__(self, txt: str):
        self.o: F = None
        self.w: A = None
        self.x: G = None
        self.r: G = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.s: C = None
        self.o: D = None
        self.r: A = None
        self.x: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.z: A = None
        self.r: G = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.r: F = None
        self.w: C = None
        self.v: A = None
        self.txt = txt

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

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

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