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

class B:
    def __init__(self, txt: str):
        self.p: G = None
        self.u: I = None
        self.y: A = None
        self.z: I = None
        self.x: D = None
        self.o: E = None
        self.r: C = None
        self.w: C = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.r: G = None
        self.q: F = None
        self.z: B = None
        self.o: H = None
        self.t: F = None
        self.p: A = None
        self.v: G = None
        self.u: I = None
        self.s: H = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.t: C = None
        self.r: A = None
        self.s: D = None
        self.w: A = None
        self.u: E = None
        self.q: C = None
        self.x: B = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.z: A = None
        self.v: E = None
        self.s: H = None
        self.y: I = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.x: C = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.p: G = None
        self.u: I = None
        self.y: A = None
        self.z: I = None
        self.x: D = None
        self.o: E = None
        self.r: C = None
        self.w: C = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.r: G = None
        self.q: F = None
        self.z: B = None
        self.o: H = None
        self.t: F = None
        self.p: A = None
        self.v: G = None
        self.u: I = None
        self.s: H = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.t: C = None
        self.r: A = None
        self.s: D = None
        self.w: A = None
        self.u: E = None
        self.q: C = None
        self.x: B = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.z: A = None
        self.v: E = None
        self.s: H = None
        self.y: I = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.x: C = None
        self.txt = txt

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

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