class A:
    def __init__(self, txt: str):
        self.w: B = None
        self.y: B = None
        self.t: I = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.u: B = None
        self.s: F = None
        self.p: J = None
        self.x: A = None
        self.o: A = None
        self.r: H = None
        self.y: I = None
        self.w: A = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.y: B = None
        self.t: A = None
        self.r: A = None
        self.p: J = None
        self.x: B = None
        self.v: G = None
        self.s: C = None
        self.w: B = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.y: B = None
        self.v: I = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.u: E = None
        self.txt = txt

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

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.u: B = None
        self.s: F = None
        self.p: J = None
        self.x: A = None
        self.o: A = None
        self.r: H = None
        self.y: I = None
        self.w: A = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.y: B = None
        self.t: A = None
        self.r: A = None
        self.p: J = None
        self.x: B = None
        self.v: G = None
        self.s: C = None
        self.w: B = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.y: B = None
        self.v: I = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.u: E = None
        self.txt = txt

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

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

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

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