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

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

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

class D:
    def __init__(self, txt: str):
        self.u: I = None
        self.v: F = None
        self.x: A = None
        self.q: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.r: A = None
        self.z: D = None
        self.t: B = None
        self.y: C = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.y: I = None
        self.r: D = None
        self.s: I = None
        self.p: B = None
        self.x: E = None
        self.txt = txt

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

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

class J:
    def __init__(self, txt: str):
        self.v: B = None
        self.t: I = None
        self.p: B = None
        self.z: E = None
        self.r: H = None
        self.x: F = None
        self.q: F = None
        self.u: C = None
        self.txt = txt

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.u: I = None
        self.v: F = None
        self.x: A = None
        self.q: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.r: A = None
        self.z: D = None
        self.t: B = None
        self.y: C = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.y: I = None
        self.r: D = None
        self.s: I = None
        self.p: B = None
        self.x: E = None
        self.txt = txt

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

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

class J:
    def __init__(self, txt: str):
        self.v: B = None
        self.t: I = None
        self.p: B = None
        self.z: E = None
        self.r: H = None
        self.x: F = None
        self.q: F = None
        self.u: C = None
        self.txt = txt

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

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