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

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

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

class D:
    def __init__(self, txt: str):
        self.q: C = None
        self.z: J = None
        self.txt = txt

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

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

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

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

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

class J:
    def __init__(self, txt: str):
        self.u: G = None
        self.w: G = None
        self.v: C = None
        self.o: F = None
        self.txt = txt

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.q: C = None
        self.z: J = None
        self.txt = txt

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

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

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

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

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

class J:
    def __init__(self, txt: str):
        self.u: G = None
        self.w: G = None
        self.v: C = None
        self.o: F = None
        self.txt = txt

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

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