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

class B:
    def __init__(self, txt: str):
        self.q: H = None
        self.z: G = None
        self.x: G = None
        self.v: C = None
        self.o: H = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.w: H = None
        self.z: A = None
        self.v: A = None
        self.x: A = None
        self.t: D = None
        self.txt = txt

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

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

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

class G:
    def __init__(self, txt: str):
        self.w: I = None
        self.x: I = None
        self.p: C = None
        self.u: D = None
        self.r: F = None
        self.o: D = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.r: I = None
        self.p: D = None
        self.y: G = None
        self.w: C = None
        self.x: C = None
        self.v: F = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.q: D = None
        self.s: H = None
        self.txt = txt

a = A("a")
h = B("h")
i = C("i")
l = D("l")
j = E("j")
n = F("n")
g = G("g")
k = H("k")
m = I("m")

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

class B:
    def __init__(self, txt: str):
        self.q: H = None
        self.z: G = None
        self.x: G = None
        self.v: C = None
        self.o: H = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.w: H = None
        self.z: A = None
        self.v: A = None
        self.x: A = None
        self.t: D = None
        self.txt = txt

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

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

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

class G:
    def __init__(self, txt: str):
        self.w: I = None
        self.x: I = None
        self.p: C = None
        self.u: D = None
        self.r: F = None
        self.o: D = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.r: I = None
        self.p: D = None
        self.y: G = None
        self.w: C = None
        self.x: C = None
        self.v: F = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.q: D = None
        self.s: H = None
        self.txt = txt

a = A("a")
h = B("h")
i = C("i")
l = D("l")
j = E("j")
n = F("n")
g = G("g")
k = H("k")
m = I("m")

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