class A:
    def __init__(self, txt: str):
        self.z: E = None
        self.x: E = None
        self.t: G = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.s: H = None
        self.u: F = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.p: G = None
        self.o: G = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.y: B = None
        self.o: A = None
        self.r: E = None
        self.u: E = None
        self.x: F = None
        self.v: H = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.u: D = None
        self.q: C = None
        self.y: H = None
        self.t: H = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.w: H = None
        self.s: D = None
        self.o: A = None
        self.z: C = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.s: F = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.s: H = None
        self.u: F = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.p: G = None
        self.o: G = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.y: B = None
        self.o: A = None
        self.r: E = None
        self.u: E = None
        self.x: F = None
        self.v: H = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.u: D = None
        self.q: C = None
        self.y: H = None
        self.t: H = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.w: H = None
        self.s: D = None
        self.o: A = None
        self.z: C = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.s: F = None
        self.txt = txt

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

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