class A:
    def __init__(self, txt: str):
        self.x: E = None
        self.y: D = None
        self.w: E = None
        self.s: E = None
        self.v: D = None
        self.r: F = None
        self.q: G = None
        self.o: D = None
        self.z: G = None
        self.t: E = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.z: F = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.w: J = None
        self.v: H = None
        self.s: F = None
        self.z: H = None
        self.r: C = None
        self.y: F = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.u: D = None
        self.o: A = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.q: G = None
        self.z: F = None
        self.s: J = None
        self.w: E = None
        self.v: A = None
        self.r: J = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.q: E = None
        self.o: A = None
        self.t: J = None
        self.p: G = None
        self.v: J = None
        self.z: H = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.r: D = None
        self.t: A = None
        self.u: B = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.z: F = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.w: J = None
        self.v: H = None
        self.s: F = None
        self.z: H = None
        self.r: C = None
        self.y: F = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.u: D = None
        self.o: A = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.q: G = None
        self.z: F = None
        self.s: J = None
        self.w: E = None
        self.v: A = None
        self.r: J = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.q: E = None
        self.o: A = None
        self.t: J = None
        self.p: G = None
        self.v: J = None
        self.z: H = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.r: D = None
        self.t: A = None
        self.u: B = None
        self.txt = txt

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

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