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

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

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

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

class E:
    def __init__(self, txt: str):
        self.x: F = None
        self.txt = txt

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

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

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

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

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

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

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

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

class E:
    def __init__(self, txt: str):
        self.x: F = None
        self.txt = txt

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

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

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

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

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