class A:
    def __init__(self, txt: str):
        self.x: F = None
        self.t: H = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.y: H = None
        self.r: A = None
        self.s: E = None
        self.v: E = None
        self.t: D = None
        self.o: E = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.x: G = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.s: H = None
        self.u: A = None
        self.w: F = None
        self.q: B = None
        self.x: C = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.v: A = None
        self.r: F = None
        self.p: E = None
        self.w: D = None
        self.t: F = None
        self.y: A = None
        self.txt = txt

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

k.x = d
k.t = m
h.p = n
c.y = m
c.r = k
c.s = a
c.v = a
c.o = a
c.t = l
l.x = c
a.q = d
a.p = c
a.y = m
a.t = n
d.x = n
n.s = m
n.u = k
n.w = d
n.q = h
n.x = c
m.v = k
m.y = k
m.r = d
m.t = d
m.p = a
m.w = l
assert m.v.t.r.x.txt == "
class A:
    def __init__(self, txt: str):
        self.x: F = None
        self.t: H = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.y: H = None
        self.r: A = None
        self.s: E = None
        self.v: E = None
        self.t: D = None
        self.o: E = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.x: G = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.s: H = None
        self.u: A = None
        self.w: F = None
        self.q: B = None
        self.x: C = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.v: A = None
        self.r: F = None
        self.p: E = None
        self.w: D = None
        self.t: F = None
        self.y: A = None
        self.txt = txt

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

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