class A:
    def __init__(self, txt: str):
        self.s: B = None
        self.z: G = None
        self.w: D = None
        self.v: F = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.u: J = None
        self.p: J = None
        self.x: G = None
        self.q: H = None
        self.v: G = None
        self.o: J = None
        self.s: E = None
        self.z: E = None
        self.txt = txt

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.t: I = None
        self.v: J = None
        self.y: A = None
        self.z: I = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.u: G = None
        self.y: A = None
        self.w: D = None
        self.s: J = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.v: F = None
        self.z: G = None
        self.u: A = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.w: B = None
        self.txt = txt

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

n.s = g
n.z = b
n.w = c
n.v = d
g.u = f
g.p = f
g.o = f
g.x = b
g.v = b
g.q = l
g.s = m
g.z = m
h.u = f
h.p = b
c.x = h
c.u = n
c.z = f
c.w = f
c.o = b
m.z = b
d.o = g
d.u = g
b.t = j
b.z = j
b.v = f
b.y = n
l.u = b
l.y = n
l.w = c
l.s = f
j.v = d
j.z = b
j.u = n
f.w = g
assert n.z.y.z.v.w.o.w.p.w.txt == "
class A:
    def __init__(self, txt: str):
        self.s: B = None
        self.z: G = None
        self.w: D = None
        self.v: F = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.u: J = None
        self.p: J = None
        self.x: G = None
        self.q: H = None
        self.v: G = None
        self.o: J = None
        self.s: E = None
        self.z: E = None
        self.txt = txt

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.t: I = None
        self.v: J = None
        self.y: A = None
        self.z: I = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.u: G = None
        self.y: A = None
        self.w: D = None
        self.s: J = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.v: F = None
        self.z: G = None
        self.u: A = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.w: B = None
        self.txt = txt

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

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