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

class B:
    def __init__(self, txt: str):
        self.u: E = None
        self.o: E = None
        self.t: I = None
        self.v: F = None
        self.w: C = None
        self.s: C = None
        self.txt = txt

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.t: C = None
        self.o: I = None
        self.p: J = None
        self.s: H = None
        self.u: J = None
        self.z: H = None
        self.w: E = None
        self.v: F = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.q: J = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.o: G = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.u: E = None
        self.o: E = None
        self.t: I = None
        self.v: F = None
        self.w: C = None
        self.s: C = None
        self.txt = txt

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.t: C = None
        self.o: I = None
        self.p: J = None
        self.s: H = None
        self.u: J = None
        self.z: H = None
        self.w: E = None
        self.v: F = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.q: J = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.o: G = None
        self.txt = txt

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

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