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

class B:
    def __init__(self, txt: str):
        self.q: I = None
        self.x: E = None
        self.w: D = None
        self.t: A = None
        self.y: J = None
        self.s: I = None
        self.u: H = None
        self.o: H = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.o: G = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.y: H = None
        self.p: B = None
        self.s: C = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.z: B = None
        self.o: F = None
        self.w: E = None
        self.x: H = None
        self.p: I = None
        self.v: B = None
        self.q: J = None
        self.s: D = None
        self.txt = txt

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

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.q: I = None
        self.x: E = None
        self.w: D = None
        self.t: A = None
        self.y: J = None
        self.s: I = None
        self.u: H = None
        self.o: H = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.o: G = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.y: H = None
        self.p: B = None
        self.s: C = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.z: B = None
        self.o: F = None
        self.w: E = None
        self.x: H = None
        self.p: I = None
        self.v: B = None
        self.q: J = None
        self.s: D = None
        self.txt = txt

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

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

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

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

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