class A:
    def __init__(self, txt: str):
        self.u: F = None
        self.r: H = None
        self.z: F = None
        self.x: D = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.z: E = None
        self.p: E = None
        self.q: A = None
        self.s: D = None
        self.t: F = None
        self.u: D = None
        self.v: H = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.z: J = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.o: E = None
        self.r: A = None
        self.z: B = None
        self.v: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.y: I = None
        self.p: D = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.z: A = None
        self.u: C = None
        self.y: E = None
        self.v: I = None
        self.x: I = None
        self.w: H = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.s: F = None
        self.r: C = None
        self.u: H = None
        self.x: E = None
        self.y: A = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.u: G = None
        self.t: D = None
        self.w: D = None
        self.v: D = None
        self.r: A = None
        self.txt = txt

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

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

a = A("a")
j = B("j")
d = C("d")
f = D("f")
e = E("e")
k = F("k")
b = G("b")
g = H("g")
l = I("l")
i = J("i")

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

class B:
    def __init__(self, txt: str):
        self.z: E = None
        self.p: E = None
        self.q: A = None
        self.s: D = None
        self.t: F = None
        self.u: D = None
        self.v: H = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.z: J = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.o: E = None
        self.r: A = None
        self.z: B = None
        self.v: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.y: I = None
        self.p: D = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.z: A = None
        self.u: C = None
        self.y: E = None
        self.v: I = None
        self.x: I = None
        self.w: H = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.s: F = None
        self.r: C = None
        self.u: H = None
        self.x: E = None
        self.y: A = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.u: G = None
        self.t: D = None
        self.w: D = None
        self.v: D = None
        self.r: A = None
        self.txt = txt

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

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

a = A("a")
j = B("j")
d = C("d")
f = D("f")
e = E("e")
k = F("k")
b = G("b")
g = H("g")
l = I("l")
i = J("i")

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