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

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

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

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

class E:
    def __init__(self, txt: str):
        self.w: F = None
        self.s: B = None
        self.r: A = None
        self.x: B = None
        self.u: C = None
        self.o: C = None
        self.txt = txt

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

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

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

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

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

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

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

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

class E:
    def __init__(self, txt: str):
        self.w: F = None
        self.s: B = None
        self.r: A = None
        self.x: B = None
        self.u: C = None
        self.o: C = None
        self.txt = txt

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

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

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

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

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