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

class B:
    def __init__(self, txt: str):
        self.t: E = None
        self.txt = txt

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.z: E = None
        self.w: A = None
        self.u: B = None
        self.o: C = None
        self.v: F = None
        self.txt = txt

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

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

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

class B:
    def __init__(self, txt: str):
        self.t: E = None
        self.txt = txt

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.z: E = None
        self.w: A = None
        self.u: B = None
        self.o: C = None
        self.v: F = None
        self.txt = txt

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

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

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