class A:
    def __init__(self, txt: str):
        self.y: B = None
        self.txt = txt

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.v: E = None
        self.r: B = None
        self.x: D = None
        self.q: H = None
        self.t: B = None
        self.o: H = None
        self.p: C = None
        self.txt = txt

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

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

k = A("k")
n = B("n")
f = C("f")
e = D("e")
h = E("h")
j = F("j")
m = G("m")
g = H("g")

k.y = n
n.u = k
n.s = g
n.p = e
f.v = h
e.q = h
e.p = j
e.z = j
e.y = g
e.s = g
e.r = g
e.t = m
e.o = n
h.t = m
h.z = m
h.p = k
j.v = h
j.r = n
j.t = n
j.x = e
j.q = g
j.o = g
j.p = f
m.z = n
m.p = n
m.x = k
g.v = j
g.x = f
g.o = k
g.p = h
assert k.y.s.x.v.t.p.u.txt == "
class A:
    def __init__(self, txt: str):
        self.y: B = None
        self.txt = txt

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.v: E = None
        self.r: B = None
        self.x: D = None
        self.q: H = None
        self.t: B = None
        self.o: H = None
        self.p: C = None
        self.txt = txt

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

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

k = A("k")
n = B("n")
f = C("f")
e = D("e")
h = E("h")
j = F("j")
m = G("m")
g = H("g")

k.y = n
n.u = k
n.s = g
n.p = e
f.v = h
e.q = h
e.p = j
e.z = j
e.y = g
e.s = g
e.r = g
e.t = m
e.o = n
h.t = m
h.z = m
h.p = k
j.v = h
j.r = n
j.t = n
j.x = e
j.q = g
j.o = g
j.p = f
m.z = n
m.p = n
m.x = k
g.v = j
g.x = f
g.o = k
g.p = h
assert k.y.s.x.v.t.p.u.txt == "k"