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

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

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

class D:
    def __init__(self, txt: str):
        self.y: A = None
        self.u: H = None
        self.v: C = None
        self.q: G = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.y: F = None
        self.x: D = None
        self.p: F = None
        self.v: F = None
        self.w: C = None
        self.o: F = None
        self.u: F = None
        self.z: H = None
        self.txt = txt

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

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

class H:
    def __init__(self, txt: str):
        self.p: E = None
        self.v: B = None
        self.s: E = None
        self.txt = txt

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.y: A = None
        self.u: H = None
        self.v: C = None
        self.q: G = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.y: F = None
        self.x: D = None
        self.p: F = None
        self.v: F = None
        self.w: C = None
        self.o: F = None
        self.u: F = None
        self.z: H = None
        self.txt = txt

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

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

class H:
    def __init__(self, txt: str):
        self.p: E = None
        self.v: B = None
        self.s: E = None
        self.txt = txt

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

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