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

class B:
    def __init__(self, txt: str):
        self.q: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.w: I = None
        self.o: H = None
        self.u: B = None
        self.y: D = None
        self.q: E = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.u: G = None
        self.w: H = None
        self.s: I = None
        self.p: C = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.u: B = None
        self.v: D = None
        self.w: F = None
        self.q: J = None
        self.o: J = None
        self.txt = txt

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

class J:
    def __init__(self, txt: str):
        self.r: C = None
        self.o: B = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.q: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.w: I = None
        self.o: H = None
        self.u: B = None
        self.y: D = None
        self.q: E = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.u: G = None
        self.w: H = None
        self.s: I = None
        self.p: C = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.u: B = None
        self.v: D = None
        self.w: F = None
        self.q: J = None
        self.o: J = None
        self.txt = txt

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

class J:
    def __init__(self, txt: str):
        self.r: C = None
        self.o: B = None
        self.txt = txt

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

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