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

class B:
    def __init__(self, txt: str):
        self.w: J = None
        self.y: I = None
        self.p: F = None
        self.q: I = None
        self.x: C = None
        self.z: F = None
        self.t: G = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.q: B = None
        self.o: B = None
        self.s: B = None
        self.w: A = None
        self.z: B = None
        self.v: J = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.o: I = None
        self.q: D = None
        self.x: H = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.o: B = None
        self.y: J = None
        self.x: C = None
        self.s: J = None
        self.r: D = None
        self.q: I = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.z: D = None
        self.txt = txt

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

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

class J:
    def __init__(self, txt: str):
        self.r: G = None
        self.z: F = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.w: J = None
        self.y: I = None
        self.p: F = None
        self.q: I = None
        self.x: C = None
        self.z: F = None
        self.t: G = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.q: B = None
        self.o: B = None
        self.s: B = None
        self.w: A = None
        self.z: B = None
        self.v: J = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.o: I = None
        self.q: D = None
        self.x: H = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.o: B = None
        self.y: J = None
        self.x: C = None
        self.s: J = None
        self.r: D = None
        self.q: I = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.z: D = None
        self.txt = txt

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

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

class J:
    def __init__(self, txt: str):
        self.r: G = None
        self.z: F = None
        self.txt = txt

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

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