class A:
    def __init__(self, txt: str):
        self.r: F = None
        self.s: C = None
        self.u: G = None
        self.t: J = None
        self.z: H = None
        self.q: C = None
        self.y: D = None
        self.x: F = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.u: D = None
        self.p: D = None
        self.q: J = None
        self.x: I = None
        self.t: J = None
        self.s: A = None
        self.v: C = None
        self.y: G = None
        self.z: A = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.t: D = None
        self.z: J = None
        self.y: B = None
        self.r: I = None
        self.p: H = None
        self.s: E = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.q: A = None
        self.r: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.v: A = None
        self.r: B = None
        self.q: B = None
        self.txt = txt

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

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

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

class I:
    def __init__(self, txt: str):
        self.v: A = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.q: G = None
        self.x: E = None
        self.r: F = None
        self.u: I = None
        self.s: G = None
        self.y: F = None
        self.txt = txt

l = A("l")
m = B("m")
i = C("i")
j = D("j")
k = E("k")
h = F("h")
n = G("n")
g = H("g")
f = I("f")
e = J("e")

l.r = h
l.x = h
l.s = i
l.q = i
l.u = n
l.t = e
l.z = g
l.y = j
m.u = j
m.p = j
m.q = e
m.t = e
m.x = f
m.s = l
m.z = l
m.v = i
m.y = n
i.t = j
i.z = e
i.y = m
i.r = f
i.p = g
i.s = k
j.q = l
j.r = k
k.v = l
k.r = m
k.q = m
h.r = g
n.v = k
g.w = n
g.v = n
g.z = n
g.p = m
g.u = f
g.s = i
g.y = l
g.r = k
f.v = l
e.q = n
e.s = n
e.x = k
e.r = h
e.y = h
e.u = f
assert f.v.s.s.v.s.r.v.u.v.v.txt == "
class A:
    def __init__(self, txt: str):
        self.r: F = None
        self.s: C = None
        self.u: G = None
        self.t: J = None
        self.z: H = None
        self.q: C = None
        self.y: D = None
        self.x: F = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.u: D = None
        self.p: D = None
        self.q: J = None
        self.x: I = None
        self.t: J = None
        self.s: A = None
        self.v: C = None
        self.y: G = None
        self.z: A = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.t: D = None
        self.z: J = None
        self.y: B = None
        self.r: I = None
        self.p: H = None
        self.s: E = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.q: A = None
        self.r: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.v: A = None
        self.r: B = None
        self.q: B = None
        self.txt = txt

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

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

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

class I:
    def __init__(self, txt: str):
        self.v: A = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.q: G = None
        self.x: E = None
        self.r: F = None
        self.u: I = None
        self.s: G = None
        self.y: F = None
        self.txt = txt

l = A("l")
m = B("m")
i = C("i")
j = D("j")
k = E("k")
h = F("h")
n = G("n")
g = H("g")
f = I("f")
e = J("e")

l.r = h
l.x = h
l.s = i
l.q = i
l.u = n
l.t = e
l.z = g
l.y = j
m.u = j
m.p = j
m.q = e
m.t = e
m.x = f
m.s = l
m.z = l
m.v = i
m.y = n
i.t = j
i.z = e
i.y = m
i.r = f
i.p = g
i.s = k
j.q = l
j.r = k
k.v = l
k.r = m
k.q = m
h.r = g
n.v = k
g.w = n
g.v = n
g.z = n
g.p = m
g.u = f
g.s = i
g.y = l
g.r = k
f.v = l
e.q = n
e.s = n
e.x = k
e.r = h
e.y = h
e.u = f
assert f.v.s.s.v.s.r.v.u.v.v.txt == "l"