class A:
    def __init__(self, txt: str):
        self.p: E = None
        self.t: D = None
        self.s: C = None
        self.r: F = None
        self.u: H = None
        self.o: D = None
        self.q: E = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.w: C = None
        self.z: D = None
        self.y: E = None
        self.s: H = None
        self.r: F = None
        self.t: A = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.y: D = None
        self.r: G = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.t: E = None
        self.r: G = None
        self.w: A = None
        self.y: A = None
        self.u: G = None
        self.o: C = None
        self.v: B = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.r: F = None
        self.z: B = None
        self.txt = txt

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

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

class H:
    def __init__(self, txt: str):
        self.z: F = None
        self.v: G = None
        self.x: E = None
        self.r: G = None
        self.u: B = None
        self.txt = txt

b = A("b")
k = B("k")
n = C("n")
h = D("h")
m = E("m")
g = F("g")
l = G("l")
f = H("f")
a = C("a")

b.p = m
b.q = m
b.t = h
b.o = h
b.s = a
b.r = g
b.u = f
k.w = n
k.z = h
k.y = m
k.s = f
k.r = g
k.t = b
n.y = h
n.r = l
h.t = m
h.r = l
h.u = l
h.w = b
h.y = b
h.o = a
h.v = k
m.r = g
m.z = k
g.q = m
g.z = k
g.y = a
l.w = h
l.p = m
l.u = n
f.z = g
f.v = l
f.r = l
f.x = m
f.u = k
a.y = h
a.r = l
assert l.p.z.y.r.q.z.txt == "
class A:
    def __init__(self, txt: str):
        self.p: E = None
        self.t: D = None
        self.s: C = None
        self.r: F = None
        self.u: H = None
        self.o: D = None
        self.q: E = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.w: C = None
        self.z: D = None
        self.y: E = None
        self.s: H = None
        self.r: F = None
        self.t: A = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.y: D = None
        self.r: G = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.t: E = None
        self.r: G = None
        self.w: A = None
        self.y: A = None
        self.u: G = None
        self.o: C = None
        self.v: B = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.r: F = None
        self.z: B = None
        self.txt = txt

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

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

class H:
    def __init__(self, txt: str):
        self.z: F = None
        self.v: G = None
        self.x: E = None
        self.r: G = None
        self.u: B = None
        self.txt = txt

b = A("b")
k = B("k")
n = C("n")
h = D("h")
m = E("m")
g = F("g")
l = G("l")
f = H("f")
a = C("a")

b.p = m
b.q = m
b.t = h
b.o = h
b.s = a
b.r = g
b.u = f
k.w = n
k.z = h
k.y = m
k.s = f
k.r = g
k.t = b
n.y = h
n.r = l
h.t = m
h.r = l
h.u = l
h.w = b
h.y = b
h.o = a
h.v = k
m.r = g
m.z = k
g.q = m
g.z = k
g.y = a
l.w = h
l.p = m
l.u = n
f.z = g
f.v = l
f.r = l
f.x = m
f.u = k
a.y = h
a.r = l
assert l.p.z.y.r.q.z.txt == "k"