class A:
    def __init__(self, txt: str):
        self.t: F = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.t: F = None
        self.p: C = None
        self.v: G = None
        self.r: G = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.p: F = None
        self.q: A = None
        self.r: G = None
        self.o: A = None
        self.t: H = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.w: C = None
        self.q: H = None
        self.r: B = None
        self.z: H = None
        self.y: J = None
        self.x: G = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.o: H = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.q: J = None
        self.t: F = None
        self.txt = txt

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.t: F = None
        self.p: C = None
        self.v: G = None
        self.r: G = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.p: F = None
        self.q: A = None
        self.r: G = None
        self.o: A = None
        self.t: H = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.w: C = None
        self.q: H = None
        self.r: B = None
        self.z: H = None
        self.y: J = None
        self.x: G = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.o: H = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.q: J = None
        self.t: F = None
        self.txt = txt

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

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

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

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