class A:
    def __init__(self, txt: str):
        self.r: E = None
        self.y: E = None
        self.w: H = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.r: G = None
        self.q: F = None
        self.w: H = None
        self.p: A = None
        self.x: A = None
        self.y: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.s: A = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.u: A = None
        self.w: J = None
        self.t: B = None
        self.y: F = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.w: G = None
        self.z: C = None
        self.t: C = None
        self.v: G = None
        self.p: A = None
        self.r: G = None
        self.x: C = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.z: D = None
        self.v: I = None
        self.r: F = None
        self.x: A = None
        self.txt = txt

g = A("g")
d = B("d")
h = C("h")
i = D("i")
k = E("k")
f = F("f")
a = G("a")
c = H("c")
m = I("m")
j = J("j")

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

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

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

class D:
    def __init__(self, txt: str):
        self.r: G = None
        self.q: F = None
        self.w: H = None
        self.p: A = None
        self.x: A = None
        self.y: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.s: A = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.u: A = None
        self.w: J = None
        self.t: B = None
        self.y: F = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.w: G = None
        self.z: C = None
        self.t: C = None
        self.v: G = None
        self.p: A = None
        self.r: G = None
        self.x: C = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.z: D = None
        self.v: I = None
        self.r: F = None
        self.x: A = None
        self.txt = txt

g = A("g")
d = B("d")
h = C("h")
i = D("i")
k = E("k")
f = F("f")
a = G("a")
c = H("c")
m = I("m")
j = J("j")

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