class A:
    def __init__(self, txt: str):
        self.x: H = None
        self.z: I = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.y: A = None
        self.u: I = None
        self.r: A = None
        self.o: G = None
        self.v: F = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.r: H = None
        self.q: B = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.v: G = None
        self.o: H = None
        self.x: A = None
        self.r: G = None
        self.z: H = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.x: E = None
        self.r: I = None
        self.p: D = None
        self.v: E = None
        self.o: C = None
        self.s: E = None
        self.q: C = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.p: I = None
        self.z: F = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.z: E = None
        self.p: D = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.y: A = None
        self.u: I = None
        self.r: A = None
        self.o: G = None
        self.v: F = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.r: H = None
        self.q: B = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.v: G = None
        self.o: H = None
        self.x: A = None
        self.r: G = None
        self.z: H = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.x: E = None
        self.r: I = None
        self.p: D = None
        self.v: E = None
        self.o: C = None
        self.s: E = None
        self.q: C = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.p: I = None
        self.z: F = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.z: E = None
        self.p: D = None
        self.txt = txt

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

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