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

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

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

class D:
    def __init__(self, txt: str):
        self.w: J = None
        self.x: C = None
        self.v: F = None
        self.r: J = None
        self.o: I = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.q: G = None
        self.v: G = None
        self.z: B = None
        self.o: C = None
        self.w: I = None
        self.u: J = None
        self.y: C = None
        self.txt = txt

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

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

class H:
    def __init__(self, txt: str):
        self.r: C = None
        self.x: F = None
        self.t: J = None
        self.w: I = None
        self.txt = txt

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

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

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.w: J = None
        self.x: C = None
        self.v: F = None
        self.r: J = None
        self.o: I = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.q: G = None
        self.v: G = None
        self.z: B = None
        self.o: C = None
        self.w: I = None
        self.u: J = None
        self.y: C = None
        self.txt = txt

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

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

class H:
    def __init__(self, txt: str):
        self.r: C = None
        self.x: F = None
        self.t: J = None
        self.w: I = None
        self.txt = txt

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

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

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

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