class A:
    def __init__(self, txt: str):
        self.r: H = None
        self.s: D = None
        self.w: J = None
        self.t: D = None
        self.o: C = None
        self.q: G = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.s: J = None
        self.u: G = None
        self.w: E = None
        self.r: D = None
        self.p: E = None
        self.q: C = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.v: A = None
        self.w: J = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.v: B = None
        self.p: A = None
        self.w: G = None
        self.y: F = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.t: E = None
        self.q: B = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.s: G = None
        self.u: J = None
        self.r: B = None
        self.txt = txt

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.s: J = None
        self.u: G = None
        self.w: E = None
        self.r: D = None
        self.p: E = None
        self.q: C = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.v: A = None
        self.w: J = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.v: B = None
        self.p: A = None
        self.w: G = None
        self.y: F = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.t: E = None
        self.q: B = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.s: G = None
        self.u: J = None
        self.r: B = None
        self.txt = txt

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

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

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

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