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

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

class C:
    def __init__(self, txt: str):
        self.q: H = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.z: H = None
        self.r: G = None
        self.t: H = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.q: G = None
        self.u: C = None
        self.txt = txt

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

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.q: H = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.z: H = None
        self.r: G = None
        self.t: H = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.q: G = None
        self.u: C = None
        self.txt = txt

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

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

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

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